Skip to content

Commit 5aaae20

Browse files
authored
Merge branch 'main' into dependabot/npm_and_yarn/multi-a28ee524ce
2 parents 1cb6de1 + 03053ac commit 5aaae20

10 files changed

Lines changed: 942 additions & 738 deletions

File tree

integration_tests/correct_forwarder_snapshot.json

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -885,8 +885,7 @@
885885
"DD_MERGE_XRAY_TRACES": false,
886886
"DD_LOGS_INJECTION": true,
887887
"DD_SERVERLESS_LOGS_ENABLED": true,
888-
"DD_CAPTURE_LAMBDA_PAYLOAD": false,
889-
"AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper"
888+
"DD_CAPTURE_LAMBDA_PAYLOAD": false
890889
}
891890
},
892891
"Role": {
@@ -937,8 +936,7 @@
937936
"DD_MERGE_XRAY_TRACES": false,
938937
"DD_LOGS_INJECTION": true,
939938
"DD_SERVERLESS_LOGS_ENABLED": true,
940-
"DD_CAPTURE_LAMBDA_PAYLOAD": false,
941-
"AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper"
939+
"DD_CAPTURE_LAMBDA_PAYLOAD": false
942940
}
943941
},
944942
"Role": {
@@ -989,8 +987,7 @@
989987
"DD_MERGE_XRAY_TRACES": false,
990988
"DD_LOGS_INJECTION": true,
991989
"DD_SERVERLESS_LOGS_ENABLED": true,
992-
"DD_CAPTURE_LAMBDA_PAYLOAD": false,
993-
"AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper"
990+
"DD_CAPTURE_LAMBDA_PAYLOAD": false
994991
}
995992
},
996993
"Role": {
@@ -1041,8 +1038,7 @@
10411038
"DD_MERGE_XRAY_TRACES": false,
10421039
"DD_LOGS_INJECTION": true,
10431040
"DD_SERVERLESS_LOGS_ENABLED": true,
1044-
"DD_CAPTURE_LAMBDA_PAYLOAD": false,
1045-
"AWS_LAMBDA_EXEC_WRAPPER": "/opt/datadog_wrapper"
1041+
"DD_CAPTURE_LAMBDA_PAYLOAD": false
10461042
}
10471043
},
10481044
"Role": {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "serverless-plugin-datadog",
3-
"version": "5.111.0",
3+
"version": "5.115.0",
44
"description": "Serverless plugin to automatically instrument python and node functions with datadog tracing",
55
"main": "dist/src/index.js",
66
"repository": "https://github.com/DataDog/serverless-plugin-datadog",

scripts/generate_layers_json.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ LAYER_NAMES=(
1818
"Datadog-Node18-x"
1919
"Datadog-Node20-x"
2020
"Datadog-Node22-x"
21+
"Datadog-Node24-x"
2122
"Datadog-Python37"
2223
"Datadog-Python38"
2324
"Datadog-Python38-ARM"
@@ -31,6 +32,8 @@ LAYER_NAMES=(
3132
"Datadog-Python312-ARM"
3233
"Datadog-Python313"
3334
"Datadog-Python313-ARM"
35+
"Datadog-Python314"
36+
"Datadog-Python314-ARM"
3437
"Datadog-Ruby3-2"
3538
"Datadog-Ruby3-2-ARM"
3639
"Datadog-Ruby3-3"
@@ -49,6 +52,7 @@ JSON_LAYER_NAMES=(
4952
"nodejs18.x"
5053
"nodejs20.x"
5154
"nodejs22.x"
55+
"nodejs24.x"
5256
"python3.7"
5357
"python3.8"
5458
"python3.8-arm"
@@ -62,6 +66,8 @@ JSON_LAYER_NAMES=(
6266
"python3.12-arm"
6367
"python3.13"
6468
"python3.13-arm"
69+
"python3.14"
70+
"python3.14-arm"
6571
"ruby3.2"
6672
"ruby3.2-arm"
6773
"ruby3.3"

src/env.spec.ts

Lines changed: 87 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ describe("setEnvConfiguration", () => {
504504
enableXrayTracing: true,
505505
enableDDTracing: true,
506506
enableDDLogs: true,
507-
addExtension: false,
507+
addExtension: true,
508508
enableTags: true,
509509
injectLogContext: false,
510510
subscribeToAccessLogs: true,
@@ -526,7 +526,6 @@ describe("setEnvConfiguration", () => {
526526
DD_API_KEY: "1234",
527527
DD_API_KEY_SECRET_ARN: "some-resource:from:aws:secrets-manager:arn",
528528
DD_CAPTURE_LAMBDA_PAYLOAD: false,
529-
DD_FLUSH_TO_LOG: true,
530529
DD_KMS_API_KEY: "0912",
531530
DD_LOG_LEVEL: "debug",
532531
DD_SITE: "datadoghq.eu",
@@ -546,7 +545,6 @@ describe("setEnvConfiguration", () => {
546545
DD_API_KEY: "1234",
547546
DD_API_KEY_SECRET_ARN: "some-resource:from:aws:secrets-manager:arn",
548547
DD_CAPTURE_LAMBDA_PAYLOAD: false,
549-
DD_FLUSH_TO_LOG: true,
550548
DD_KMS_API_KEY: "0912",
551549
DD_LOG_LEVEL: "debug",
552550
DD_SITE: "datadoghq.eu",
@@ -567,7 +565,6 @@ describe("setEnvConfiguration", () => {
567565
DD_API_KEY: "1234",
568566
DD_API_KEY_SECRET_ARN: "some-resource:from:aws:secrets-manager:arn",
569567
DD_CAPTURE_LAMBDA_PAYLOAD: false,
570-
DD_FLUSH_TO_LOG: true,
571568
DD_KMS_API_KEY: "0912",
572569
DD_LOG_LEVEL: "debug",
573570
DD_SITE: "datadoghq.eu",
@@ -587,7 +584,6 @@ describe("setEnvConfiguration", () => {
587584
DD_API_KEY: "1234",
588585
DD_API_KEY_SECRET_ARN: "some-resource:from:aws:secrets-manager:arn",
589586
DD_CAPTURE_LAMBDA_PAYLOAD: false,
590-
DD_FLUSH_TO_LOG: true,
591587
DD_KMS_API_KEY: "0912",
592588
DD_LOG_LEVEL: "debug",
593589
DD_SITE: "datadoghq.eu",
@@ -605,6 +601,92 @@ describe("setEnvConfiguration", () => {
605601
]);
606602
});
607603

604+
it("skips setting AWS_LAMBDA_EXEC_WRAPPER for Java and .NET functions when addExtension is false", () => {
605+
const handlers: FunctionInfo[] = [
606+
{
607+
handler: {
608+
environment: {},
609+
events: [],
610+
},
611+
name: "function",
612+
type: RuntimeType.JAVA,
613+
},
614+
{
615+
handler: {
616+
environment: {},
617+
events: [],
618+
},
619+
name: "function2",
620+
type: RuntimeType.DOTNET,
621+
},
622+
];
623+
setEnvConfiguration(
624+
{
625+
addLayers: true,
626+
apiKey: "1234",
627+
apiKMSKey: "5678",
628+
site: "datadoghq.eu",
629+
subdomain: "app",
630+
logLevel: "debug",
631+
flushMetricsToLogs: true,
632+
enableXrayTracing: true,
633+
enableDDTracing: true,
634+
enableDDLogs: true,
635+
addExtension: false,
636+
enableTags: true,
637+
injectLogContext: false,
638+
subscribeToAccessLogs: true,
639+
subscribeToExecutionLogs: false,
640+
subscribeToStepFunctionLogs: false,
641+
exclude: ["dd-excluded-function"],
642+
enableSourceCodeIntegration: true,
643+
uploadGitMetadata: false,
644+
failOnError: false,
645+
skipCloudformationOutputs: false,
646+
},
647+
handlers,
648+
);
649+
expect(handlers).toEqual([
650+
{
651+
handler: {
652+
environment: {
653+
DD_API_KEY: "1234",
654+
DD_CAPTURE_LAMBDA_PAYLOAD: undefined,
655+
DD_FLUSH_TO_LOG: true,
656+
DD_KMS_API_KEY: "5678",
657+
DD_LOG_LEVEL: "debug",
658+
DD_SITE: "datadoghq.eu",
659+
DD_TRACE_ENABLED: true,
660+
DD_MERGE_XRAY_TRACES: true,
661+
DD_LOGS_INJECTION: false,
662+
DD_SERVERLESS_LOGS_ENABLED: true,
663+
},
664+
events: [],
665+
},
666+
name: "function",
667+
type: RuntimeType.JAVA,
668+
},
669+
{
670+
handler: {
671+
environment: {
672+
DD_API_KEY: "1234",
673+
DD_CAPTURE_LAMBDA_PAYLOAD: undefined,
674+
DD_FLUSH_TO_LOG: true,
675+
DD_KMS_API_KEY: "5678",
676+
DD_LOG_LEVEL: "debug",
677+
DD_SITE: "datadoghq.eu",
678+
DD_TRACE_ENABLED: true,
679+
DD_MERGE_XRAY_TRACES: true,
680+
DD_LOGS_INJECTION: false,
681+
DD_SERVERLESS_LOGS_ENABLED: true,
682+
},
683+
events: [],
684+
},
685+
name: "function2",
686+
type: RuntimeType.DOTNET,
687+
},
688+
]);
689+
});
608690
it("doesn't overwrite already present env vars", () => {
609691
const handlers: FunctionInfo[] = [
610692
{

src/env.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export function setEnvConfiguration(config: Configuration, handlers: FunctionInf
361361
environment[ddLlmObsAgentlessEnabled] = config.llmObsAgentlessEnabled;
362362
}
363363

364-
if (type === RuntimeType.DOTNET || type === RuntimeType.JAVA) {
364+
if ((type === RuntimeType.DOTNET || type === RuntimeType.JAVA) && config.addExtension) {
365365
if (environment[AWS_LAMBDA_EXEC_WRAPPER_VAR] === undefined) {
366366
environment[AWS_LAMBDA_EXEC_WRAPPER_VAR] = AWS_LAMBDA_EXEC_WRAPPER;
367367
} else if (environment[AWS_LAMBDA_EXEC_WRAPPER_VAR] !== AWS_LAMBDA_EXEC_WRAPPER) {

src/layer.spec.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,13 +46,15 @@ describe("findHandlers", () => {
4646
"node18-function": { handler: "myfile.handler", runtime: "nodejs18.x" },
4747
"node20-function": { handler: "myfile.handler", runtime: "nodejs20.x" },
4848
"node22-function": { handler: "myfile.handler", runtime: "nodejs22.x" },
49+
"node24-function": { handler: "myfile.handler", runtime: "nodejs24.x" },
4950
"python37-function": { handler: "myfile.handler", runtime: "python3.7" },
5051
"python38-function": { handler: "myfile.handler", runtime: "python3.8" },
5152
"python39-function": { handler: "myfile.handler", runtime: "python3.9" },
5253
"python310-function": { handler: "myfile.handler", runtime: "python3.10" },
5354
"python311-function": { handler: "myfile.handler", runtime: "python3.11" },
5455
"python312-function": { handler: "myfile.handler", runtime: "python3.12" },
5556
"python313-function": { handler: "myfile.handler", runtime: "python3.13" },
57+
"python314-function": { handler: "myfile.handler", runtime: "python3.14" },
5658
"ruby32-function": { handler: "myfile.handler", runtime: "ruby3.2" },
5759
"ruby33-function": { handler: "myfile.handler", runtime: "ruby3.3" },
5860
"java8-function": { handler: "myfile.handler", runtime: "java8" },
@@ -98,6 +100,12 @@ describe("findHandlers", () => {
98100
type: RuntimeType.NODE,
99101
runtime: "nodejs22.x",
100102
},
103+
{
104+
name: "node24-function",
105+
handler: { handler: "myfile.handler", runtime: "nodejs24.x" },
106+
type: RuntimeType.NODE,
107+
runtime: "nodejs24.x",
108+
},
101109
{
102110
name: "python37-function",
103111
handler: { handler: "myfile.handler", runtime: "python3.7" },
@@ -140,6 +148,12 @@ describe("findHandlers", () => {
140148
type: RuntimeType.PYTHON,
141149
runtime: "python3.13",
142150
},
151+
{
152+
name: "python314-function",
153+
handler: { handler: "myfile.handler", runtime: "python3.14" },
154+
type: RuntimeType.PYTHON,
155+
runtime: "python3.14",
156+
},
143157
{
144158
name: "ruby32-function",
145159
handler: { handler: "myfile.handler", runtime: "ruby3.2" },

src/layer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,15 @@ export const runtimeLookup: { [key: string]: RuntimeType } = {
5959
"nodejs18.x": RuntimeType.NODE,
6060
"nodejs20.x": RuntimeType.NODE,
6161
"nodejs22.x": RuntimeType.NODE,
62+
"nodejs24.x": RuntimeType.NODE,
6263
"python3.7": RuntimeType.PYTHON,
6364
"python3.8": RuntimeType.PYTHON,
6465
"python3.9": RuntimeType.PYTHON,
6566
"python3.10": RuntimeType.PYTHON,
6667
"python3.11": RuntimeType.PYTHON,
6768
"python3.12": RuntimeType.PYTHON,
6869
"python3.13": RuntimeType.PYTHON,
70+
"python3.14": RuntimeType.PYTHON,
6971
dotnet6: RuntimeType.DOTNET,
7072
dotnet8: RuntimeType.DOTNET,
7173
java11: RuntimeType.JAVA,
@@ -89,6 +91,7 @@ export const ARM_RUNTIME_KEYS: { [key: string]: string } = {
8991
"python3.11": "python3.11-arm",
9092
"python3.12": "python3.12-arm",
9193
"python3.13": "python3.13-arm",
94+
"python3.14": "python3.14-arm",
9295
"ruby3.2": "ruby3.2-arm",
9396
"ruby3.3": "ruby3.3-arm",
9497
extension: "extension-arm",
@@ -98,6 +101,7 @@ export const ARM_RUNTIME_KEYS: { [key: string]: string } = {
98101
"nodejs18.x": "nodejs18.x",
99102
"nodejs20.x": "nodejs20.x",
100103
"nodejs22.x": "nodejs22.x",
104+
"nodejs24.x": "nodejs24.x",
101105
// The same Java layer works for both x86 and ARM
102106
java: "java",
103107
};

0 commit comments

Comments
 (0)