AWS Lambda
This guide configures logs, traces, metrics. Replace YOUR_INGEST_KEY with your key on your server, never in a public example.
1. Choose a Lambda instrumentation layer
Section titled “1. Choose a Lambda instrumentation layer”Attach the current published layer ARN from the official Lambda instructions. Never reuse an ARN from a different region or architecture. Layer support differs by runtime. For Java/.NET use their runtime-specific Lambda instrumentation.
Runtime: Node.js or PythonLayer: official OpenTelemetry Lambda layer for your runtime, region and CPU architectureNode wrapper: AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-handlerPython wrapper: AWS_LAMBDA_EXEC_WRAPPER=/opt/otel-instrument2. Set server environment variables
Section titled “2. Set server environment variables”Set these on the running service. Keep the key out of source control, client bundles and build logs.
export OTEL_SERVICE_NAME='my-service'export OTEL_RESOURCE_ATTRIBUTES='deployment.environment.name=production'export OTEL_EXPORTER_OTLP_PROTOCOL=http/protobufexport OTEL_EXPORTER_OTLP_LOGS_ENDPOINT='https://otlp.siteqwality.com/v1/logs'export OTEL_EXPORTER_OTLP_LOGS_HEADERS='Authorization=YOUR_INGEST_KEY'export OTEL_EXPORTER_OTLP_TRACES_ENDPOINT='https://otlp.siteqwality.com/v1/traces'export OTEL_EXPORTER_OTLP_TRACES_HEADERS='Authorization=YOUR_INGEST_KEY'export OTEL_EXPORTER_OTLP_METRICS_ENDPOINT='https://otlp.siteqwality.com/v1/metrics'export OTEL_EXPORTER_OTLP_METRICS_HEADERS='Authorization=YOUR_INGEST_KEY'export OTEL_LOGS_EXPORTER=otlpexport OTEL_TRACES_EXPORTER=otlpexport OTEL_METRICS_EXPORTER=otlp3. Invoke and check the exporter
Section titled “3. Invoke and check the exporter”Use a test event accepted by your function. Configure variables through your infrastructure secret mechanism. Do not replace the function environment wholesale with a sample. Export during the invocation or use the Collector extension; a background timer may be frozen after return. CloudWatch logs are separate unless a logging bridge, extension or Firehose forwards them.
aws lambda invoke --function-name YOUR_FUNCTION --payload fileb://event.json response.jsonSee your data
Section titled “See your data”Open Logs, Traces or Metrics. New data usually shows up within a minute, and a page that says it is waiting for data switches to your data on its own. Nothing arriving? See what each status code means in failure handling.
Production checklist
Section titled “Production checklist”Store the key in your platform secret mechanism, rotate it when exposed and remove test keys. Set a stable service.name and deployment.environment.name; avoid user IDs or unbounded values in metric labels. Prefer a persistent queue, bounded retries and exporter failure monitoring. Review redaction and processors before increasing traffic.