OpenTelemetry
Every service inherits OpenTelemetry environment variables from serverless.common.yml. The collector config is collector.yaml at the repo root and is bundled into deployment packages.
Layers
Two Lambda layers are configured in shared config:
custom:
otelCollect:
layerArn:
ap-southeast-2: arn:aws:lambda:ap-southeast-2:050451360540:layer:opentelemetry-collector-grafana-arm64-v0_113_0:1
otelInstrument:
layerArn:
ap-southeast-2: arn:aws:lambda:ap-southeast-2:901920570463:layer:aws-otel-nodejs-arm64-ver-1-30-2:1| Layer | Role |
|---|---|
| Grafana collector Lambda extension | Receives local OTLP and Lambda Telemetry API events, exports to Drive OTLP gateway |
| AWS OTel Node instrumentation | Auto-instruments Lambda, AWS SDK, HTTP, DNS, gRPC, and host/process signals |
Bootstrap
AWS_LAMBDA_EXEC_WRAPPER: "/opt/otel-handler"
OPENTELEMETRY_COLLECTOR_CONFIG_URI: "/var/task/collector.yaml"
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://localhost:4318"Handlers emit OTLP to localhost; the collector exports to DRIVE_OTLP_ENDPOINT with DRIVE_OTLP_AUTH_HEADER.
Collector
collector.yaml defines:
| Component | Purpose |
|---|---|
otlp receiver | Local gRPC/HTTP OTLP on ports 4317 and 4318 |
telemetryapi receiver | AWS Lambda platform/function log stream |
attributes/service_attrs | Inserts service.namespace and deployment environment fields |
filter/logs | Drops ADOT startup noise and Node deprecation warnings |
filter/traces | Drops platform.* spans |
otlphttp/drive_otlp exporter | Sends traces, logs, and metrics to https://otlp.<root-domain> |
Instrumentations
HTTP request and response headers are captured because both OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_REQUEST and OTEL_INSTRUMENTATION_HTTP_CAPTURE_HEADERS_SERVER_RESPONSE are set to .*. Treat telemetry access accordingly; sensitive headers can be present in spans.