v2.4.2

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:

yaml
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
LayerRole
Grafana collector Lambda extensionReceives local OTLP and Lambda Telemetry API events, exports to Drive OTLP gateway
AWS OTel Node instrumentationAuto-instruments Lambda, AWS SDK, HTTP, DNS, gRPC, and host/process signals

Bootstrap

yaml
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:

ComponentPurpose
otlp receiverLocal gRPC/HTTP OTLP on ports 4317 and 4318
telemetryapi receiverAWS Lambda platform/function log stream
attributes/service_attrsInserts service.namespace and deployment environment fields
filter/logsDrops ADOT startup noise and Node deprecation warnings
filter/tracesDrops platform.* spans
otlphttp/drive_otlp exporterSends traces, logs, and metrics to https://otlp.<root-domain>

Instrumentations

OTEL_NODE_ENABLED_INSTRUMENTATIONS=aws-lambda,aws-sdk,dns,grpc,http,https,host

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.

Esc