Skip to content

Commit 721fdbd

Browse files
authored
Merge branch 'main' into ccapell/APPSEC-60752/in-app-waf-port
2 parents 0f651b4 + 398aed1 commit 721fdbd

116 files changed

Lines changed: 8428 additions & 742 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ package-lock.json
1414
/.idea/
1515

1616
.gitlab/build-*.yaml
17+
18+
# Local datadog-lambda-js tarballs produced for container integration tests
19+
integration_tests/container/*/datadog-lambda-js-local.tgz

.gitlab/input_files/build.yaml.tpl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,11 @@ unit test ({{ $runtime.name }}):
8181

8282
integration test ({{ $runtime.name }}):
8383
stage: test
84-
tags: ["arch:amd64"]
84+
# `docker-in-docker:<arch>` routes the job to a runner with a live Docker
85+
# daemon (vs. plain `arch:amd64` which only has the docker CLI). Required by
86+
# the container-image integration tests, which build & push ECR images for
87+
# the `container-{cjs,esm}_node*` functions.
88+
tags: ["docker-in-docker:amd64"]
8589
image: ${CI_DOCKER_TARGET_IMAGE}:${CI_DOCKER_TARGET_VERSION}
8690
needs:
8791
- build layer ({{ $runtime.name }})

.gitlab/scripts/publish_npm.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,4 @@ if [ -d "./dist" ]; then
2929
rm -rf ./dist
3030
fi
3131
yarn build
32-
cp ./dist/handler.cjs ./dist/handler.js
3332
npm publish

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ Besides the environment variables supported by dd-trace-js, the datadog-lambda-j
3030
| DD_COLD_START_TRACE_SKIP_LIB | optionally skip creating Cold Start Spans for a comma-separated list of libraries. Useful to limit depth or skip known libraries. | `./opentracing/tracer` |
3131
| DD_CAPTURE_LAMBDA_PAYLOAD | [Captures incoming and outgoing AWS Lambda payloads][1] in the Datadog APM spans for Lambda invocations. | `false` |
3232
| DD_CAPTURE_LAMBDA_PAYLOAD_MAX_DEPTH | Determines the level of detail captured from AWS Lambda payloads, which are then assigned as tags for the `aws.lambda` span. It specifies the nesting depth of the JSON payload structure to process. Once the specified maximum depth is reached, the tag's value is set to the stringified value of any nested elements beyond this level. <br> For example, given the input payload: <pre>{<br> "lv1" : {<br> "lv2": {<br> "lv3": "val"<br> }<br> }<br>}</pre> If the depth is set to `2`, the resulting tag's key is set to `function.request.lv1.lv2` and the value is `{\"lv3\": \"val\"}`. <br> If the depth is set to `0`, the resulting tag's key is set to `function.request` and value is `{\"lv1\":{\"lv2\":{\"lv3\": \"val\"}}}` | `10` |
33+
| DD_DURABLE_CROSS_INVOCATION_TRACING_ENABLED | For AWS Durable functions, the tracer creates extra checkpoints named `_datadog_{N}` to propagate trace context across function invocations, keeping spans from multiple invocations in one intact trace for each durable execution. | `true` |
3334

3435

3536
## Lambda Profiling Beta
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG NODE_VERSION=22
2+
FROM public.ecr.aws/lambda/nodejs:${NODE_VERSION}
3+
4+
COPY package.json handler.js ${LAMBDA_TASK_ROOT}/
5+
COPY datadog-lambda-js-local.tgz /tmp/datadog-lambda-js-local.tgz
6+
RUN cd ${LAMBDA_TASK_ROOT} \
7+
&& npm install --omit=dev \
8+
&& npm install --no-save /tmp/datadog-lambda-js-local.tgz \
9+
&& rm /tmp/datadog-lambda-js-local.tgz
10+
11+
CMD ["node_modules/datadog-lambda-js/dist/handler.handler"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
exports.handle = (event) => {
2+
return { message: "hello, dog!" };
3+
};
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "container-cjs-test",
3+
"version": "1.0.0",
4+
"private": true,
5+
"dependencies": {
6+
"dd-trace": "5.105.0"
7+
}
8+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
ARG NODE_VERSION=22
2+
FROM public.ecr.aws/lambda/nodejs:${NODE_VERSION}
3+
4+
COPY package.json handler.mjs ${LAMBDA_TASK_ROOT}/
5+
COPY datadog-lambda-js-local.tgz /tmp/datadog-lambda-js-local.tgz
6+
RUN cd ${LAMBDA_TASK_ROOT} \
7+
&& npm install --omit=dev \
8+
&& npm install --no-save /tmp/datadog-lambda-js-local.tgz \
9+
&& rm /tmp/datadog-lambda-js-local.tgz
10+
11+
CMD ["node_modules/datadog-lambda-js/dist/handler.handler"]
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import { promisify } from "util";
2+
3+
// Verify top-level await works in the container-image ESM path
4+
await promisify(setTimeout)(50);
5+
6+
export function handle(event) {
7+
return { message: "hello, dog!" };
8+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"name": "container-esm-test",
3+
"version": "1.0.0",
4+
"private": true,
5+
"type": "module",
6+
"dependencies": {
7+
"dd-trace": "5.105.0"
8+
}
9+
}

0 commit comments

Comments
 (0)