Expert guidance for configuring and deploying the OpenTelemetry Collector. Use when setting up a Collector pipeline, configuring receivers, exporters, or processors, deploying a Collector to Kubernetes or Docker, or forwarding telemetry to Dash0. Triggers on requests involving collector, pipeline, OTLP receiver, exporter, or Dash0 collector setup.
88%
Does it follow best practices?
Impact
97%
1.15xAverage score across 14 eval scenarios
Low
Low-risk findings worth noting
This is path B of AWS Lambda deployment: a single layer that combines auto-instrumentation with an exporter shipping directly to Dash0. Read the decision process first — path B is the right choice when the runtime is Node.js, Python, or Java and Dash0 is the only backend.
The Dash0 Lambda Extension replaces all three layers of path A. Do not attach the upstream Collector layer alongside it: both subscribe to the Lambda Telemetry API and the result is duplicated or dropped telemetry.
When telemetry must fan out to more than one backend, or the runtime is Ruby, use upstream OpenTelemetry layers instead.
Auto-instrumentation supports Node.js, Python, and Java, on both x86_64 and arm64.
The dash0-extension-manual layer works with any runtime: it carries no instrumentation, only the exporter, the Lambda lifecycle handling, and the extension's own event-derived enrichment.
ZIP-packaged functions attach the layer; container-image functions copy its contents into the image, see container images.
The extension is published from the Dash0 AWS account 115813213817:
arn:aws:lambda:<region>:115813213817:layer:dash0-extension-node:<version>
arn:aws:lambda:<region>:115813213817:layer:dash0-extension-python:<version>
arn:aws:lambda:<region>:115813213817:layer:dash0-extension-java:<version>
arn:aws:lambda:<region>:115813213817:layer:dash0-extension-manual:<version>Use the manual layer when the function is instrumented with the OpenTelemetry SDK in code — Go and .NET, or any runtime where you want to own the instrumentation — and only needs the extension's exporter and Lambda lifecycle handling.
Point the SDK's OTLP/HTTP exporter at the extension on loopback, http://127.0.0.1:9009.
See runtimes without an auto-instrumentation layer for the in-code setup that pairs with it.
Layers are region-scoped: the ARN must name the same region as the function.
Resolve <version> from the dash0-lambda-extension releases rather than copying a version out of any documentation, including this file.
| Variable | Required | Value |
|---|---|---|
DASH0_ENDPOINT | Yes | The OTLP/HTTP ingress endpoint, for example https://ingress.eu-west-1.aws.dash0.com:4318 |
DASH0_DATASET | No | The dataset slug telemetry is routed to; when unset the extension sends no Dash0-Dataset header and telemetry lands in the default dataset. Set it whenever the organization uses more than one dataset |
DASH0_TOKEN_SECRET_ARN | One of | ARN of the AWS Secrets Manager secret holding the auth token |
DASH0_TOKEN_SECRET_KEY | Conditional | The JSON key inside that secret; omit when the secret is a plain string. The AWS console's default "key/value" secret form produces JSON, so a secret created that way needs this variable |
DASH0_TOKEN | One of | The auth token as a literal value |
AWS_LAMBDA_EXEC_WRAPPER | For traces | /opt/wrapper |
Use DASH0_TOKEN_SECRET_ARN and grant the function's execution role secretsmanager:GetSecretValue on that secret.
The extension resolves it at runtime, so the token never enters the function configuration — this is the main operational advantage over path A, where the token must be an environment variable.
Reserve DASH0_TOKEN exclusively for throwaway experiments: a literal token in the function configuration is readable by anyone with lambda:GetFunctionConfiguration, and it ends up in the IaC source and in CloudTrail.
When both are set, DASH0_TOKEN wins.
Set the service identity attributes as on any other path, with OTEL_SERVICE_NAME and OTEL_RESOURCE_ATTRIBUTES — see resource attributes on Lambda.
Find the endpoint under Settings → Endpoints and the token under Settings → Auth Tokens.
Optional variables:
| Variable | Default | Effect |
|---|---|---|
DASH0_SEND_ON_INVOCATION_END | true | Exports before the invocation completes. Set false to export on the next invocation instead, which cuts billed duration but can delay telemetry by up to 7 minutes when no further invocation follows |
DASH0_EXTENSION_LOG_LEVEL | warn | One of trace, debug, info, warn, error |
DASH0_DISTRO_DEBUG | false | Emits extra auto-instrumentation diagnostics |
DASH0_DISABLE_AUTO_INSTRUMENTATION | false | Disables auto-instrumentation; the extension still emits a synthetic span per invocation |
DASH0_DISABLE_TELEMETRY_TRACES | false | Disables auto-instrumentation and the synthetic spans — stronger than the variable above |
DASH0_DISABLE_TELEMETRY_METRICS | false | Drops the supplementary FaaS metrics (faas.invoke_duration, faas.init_duration, dash0.faas.billed_duration, faas.mem_usage) |
DASH0_CREATE_PAYLOAD_LOG_RECORDS | true | Emits log records carrying the invocation's request and response payloads, and those of each client call. Set false to stop capturing payloads entirely |
DASH0_MASK_RULES | — | JSON array of regular expressions applied to all payloads. Setting it replaces the defaults, so restate them |
DASH0_MASK_ENV_VARS | — | JSON array of regular expressions matching environment variables to mask in telemetry. Falls back to DASH0_MASK_RULES |
DASH0_SEND_ON_INVOCATION_END is the one knob here with a real tradeoff: the default keeps telemetry timely at the cost of billed duration, and false moves the export off the current invocation at the cost of delaying the last invocation's telemetry indefinitely.
Leave it at the default unless billed duration is a measured problem.
Every environment variable is captured into telemetry, including AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY, and AWS_SESSION_TOKEN.
If you override DASH0_MASK_RULES or DASH0_MASK_ENV_VARS, keep .*key.*, .*secret.*, and .*token.* in the list, or those credentials are exported unmasked.
Write patterns as .*name.* rather than name, because Python matches from the start of the key.
Per-payload overrides — DASH0_MASK_REQUEST_BODY, DASH0_MASK_RESPONSE_BODY, DASH0_MASK_REQUEST_HEADERS, DASH0_MASK_RESPONSE_HEADERS, and DASH0_MASK_QUERY_PARAMS — take the same JSON array or the literal all, and their runtime support varies: Node.js covers all of them, Python covers some, and Java covers none.
The DASH0_MASK_* variables are a backstop, not the primary control.
Keep secrets out of telemetry at the source per sensitive data.
The extension's distro enables its own instrumentation set, which is not the same as the upstream layer's.
Notably, it enables the undici instrumentation by default, so Node.js fetch calls are traced without extra configuration — the same handler behaves differently on the two paths.
There is no per-instrumentation allowlist or denylist — nothing equivalent to OTEL_NODE_ENABLED_INSTRUMENTATIONS or OTEL_PYTHON_DISABLED_INSTRUMENTATIONS on path A.
The two coarse switches are DASH0_DISABLE_AUTO_INSTRUMENTATION=true, which turns auto-instrumentation off while the extension still emits a synthetic span per invocation, and DASH0_DISABLE_TELEMETRY_TRACES=true, which suppresses both.
To trace a library the distro does not cover, add a manual span, or instrument in code and attach dash0-extension-manual instead.
| Mode | AWS_LAMBDA_EXEC_WRAPPER | DASH0_DISABLE_TELEMETRY_LOG_COLLECTION | Collected |
|---|---|---|---|
| Traces and logs | /opt/wrapper | unset (default false) | Traces, logs, metrics |
| Traces only | /opt/wrapper | true | Traces, metrics |
| Logs only | unset | unset | Logs, metrics |
Two independent switches select the mode: AWS_LAMBDA_EXEC_WRAPPER turns auto-instrumentation on, and DASH0_DISABLE_TELEMETRY_LOG_COLLECTION turns Lambda Telemetry API log collection off.
In logs-only mode the extension binary in /opt/extensions/ reads the Lambda Telemetry API directly, so logs arrive without any auto-instrumentation.
Set the function's X-Ray tracing mode to PassThrough.
Active makes the X-Ray SDK compete with OpenTelemetry for the trace context and produces broken traces.
When Active is required for other reasons, set DASH0_XRAY_TRACES_ENABLED=true so the extension preserves the X-Ray context instead of fighting it.
Prefer PassThrough — reach for this only when something else in the account depends on Active tracing.
Remove any other vendor layer first — Datadog, New Relic, Dynatrace, Lumigo, ADOT, and the upstream OpenTelemetry layers all conflict with the Dash0 extension.
The layer list and the environment block are the only changes needed; the handler code is untouched.
Resources:
CheckoutFunction:
Type: AWS::Serverless::Function
Properties:
Runtime: nodejs22.x
Architectures: [arm64]
Handler: index.handler
Tracing: PassThrough
Layers:
- !Sub 'arn:aws:lambda:${AWS::Region}:115813213817:layer:dash0-extension-node:31'
Environment:
Variables:
AWS_LAMBDA_EXEC_WRAPPER: /opt/wrapper
DASH0_ENDPOINT: https://ingress.eu-west-1.aws.dash0.com:4318
DASH0_DATASET: production
DASH0_TOKEN_SECRET_ARN: !Ref Dash0TokenSecret
OTEL_SERVICE_NAME: checkout
OTEL_RESOURCE_ATTRIBUTES: service.namespace=shop,deployment.environment.name=production
Policies:
- AWSSecretsManagerGetSecretValuePolicy:
SecretArn: !Ref Dash0TokenSecretThe serverless-dash0 plugin attaches the layer and sets the environment variables for every function flagged with dash0-traced: true.
plugins:
- serverless-dash0
custom:
dash0:
endpoint: https://ingress.eu-west-1.aws.dash0.com:4318
dataset: production
tokenSecretArn: ${env:DASH0_TOKEN_SECRET_ARN}
functions:
checkout:
handler: index.handler
tags:
dash0-traced: trueresource "aws_lambda_function" "checkout" {
function_name = "checkout"
runtime = "nodejs22.x"
architectures = ["arm64"]
handler = "index.handler"
role = aws_iam_role.checkout.arn
layers = [
"arn:aws:lambda:${var.region}:115813213817:layer:dash0-extension-node:31",
]
tracing_config {
mode = "PassThrough"
}
environment {
variables = {
AWS_LAMBDA_EXEC_WRAPPER = "/opt/wrapper"
DASH0_ENDPOINT = "https://ingress.eu-west-1.aws.dash0.com:4318"
DASH0_DATASET = "production"
DASH0_TOKEN_SECRET_ARN = aws_secretsmanager_secret.dash0_token.arn
OTEL_SERVICE_NAME = "checkout"
OTEL_RESOURCE_ATTRIBUTES = "service.namespace=shop,deployment.environment.name=production"
}
}
}const dash0Layer = lambda.LayerVersion.fromLayerVersionArn(
this,
'Dash0Layer',
`arn:aws:lambda:${this.region}:115813213817:layer:dash0-extension-node:31`,
);
const checkout = new lambda.Function(this, 'Checkout', {
runtime: lambda.Runtime.NODEJS_22_X,
architecture: lambda.Architecture.ARM_64,
handler: 'index.handler',
code: lambda.Code.fromAsset('src'),
tracing: lambda.Tracing.PASS_THROUGH,
layers: [dash0Layer],
environment: {
AWS_LAMBDA_EXEC_WRAPPER: '/opt/wrapper',
DASH0_ENDPOINT: 'https://ingress.eu-west-1.aws.dash0.com:4318',
DASH0_DATASET: 'production',
DASH0_TOKEN_SECRET_ARN: dash0Token.secretArn,
OTEL_SERVICE_NAME: 'checkout',
OTEL_RESOURCE_ATTRIBUTES: 'service.namespace=shop,deployment.environment.name=production',
},
});
dash0Token.grantRead(checkout);aws lambda update-function-configuration \
--function-name checkout \
--layers "arn:aws:lambda:eu-west-1:115813213817:layer:dash0-extension-node:31" \
--environment "Variables={AWS_LAMBDA_EXEC_WRAPPER=/opt/wrapper,DASH0_ENDPOINT=https://ingress.eu-west-1.aws.dash0.com:4318,DASH0_DATASET=production,DASH0_TOKEN_SECRET_ARN=$DASH0_TOKEN_SECRET_ARN,OTEL_SERVICE_NAME=checkout}"update-function-configuration replaces the entire layer list and the entire environment block.
Read the current configuration with aws lambda get-function-configuration and merge, or the call silently drops layers and variables the function already had.
Dash0 publishes an extension image per runtime, so a container-image function copies /opt out of it instead of attaching the layer:
FROM public.ecr.aws/lambda/nodejs:20
COPY --from=public.ecr.aws/r1r2x3i6/extension-node:latest /opt /opt
ENV AWS_LAMBDA_EXEC_WRAPPER=/opt/wrapper
ENV DASH0_ENDPOINT=https://ingress.eu-west-1.aws.dash0.com:4318
ENV DASH0_DATASET=production
COPY index.js ${LAMBDA_TASK_ROOT}/
CMD ["index.handler"]The image tags are extension-node, extension-python, and extension-java.
Supply DASH0_TOKEN_SECRET_ARN through the function configuration rather than baking a token into the image.
Follow the shared validation steps.
When step 2 shows no extension line in the log group, set DASH0_EXTENSION_LOG_LEVEL=debug temporarily, invoke again, and remove it afterwards.
AWS_LAMBDA_EXEC_WRAPPER unset.
The extension collects logs only, and the absence of traces reads as a broken layer.DASH0_TOKEN as a literal in the function configuration or IaC.
The value is readable through lambda:GetFunctionConfiguration and is committed to source control.
Use DASH0_TOKEN_SECRET_ARN with an AWS Secrets Manager secret.DASH0_TOKEN_SECRET_ARN at a JSON secret without DASH0_TOKEN_SECRET_KEY.
The AWS console's default secret form produces JSON, so the extension reads the whole JSON document as the token and every export is rejected with a 401.Active.
The X-Ray SDK and OpenTelemetry compete for the trace context; set PassThrough, or DASH0_XRAY_TRACES_ENABLED=true when Active is mandatory.ResourceNotFoundException..tessl-plugin
skills
otel-collector
otel-instrumentation
otel-ottl
otel-semantic-conventions