Skip to content

Embed OTel Collector Lambda extension in connector images#61

Draft
gontzess wants to merge 5 commits intomainfrom
gontzess/otel-col-ext-lambda
Draft

Embed OTel Collector Lambda extension in connector images#61
gontzess wants to merge 5 commits intomainfrom
gontzess/otel-col-ext-lambda

Conversation

@gontzess
Copy link
Copy Markdown
Contributor

Why

Lambda connectors have in-process OTEL instrumentation but no reliable way to flush telemetry before Lambda shuts down, crashes, or freezes. The otel-lambda collector extension runs as a separate process in the Lambda execution environment and can flush buffered telemetry during the Shutdown phase.

What this changes

Embeds the opentelemetry-lambda collector extension into Lambda connector images via a multi-stage Docker build:

  • Dockerfile template: Stage 1 downloads otel-lambda collector v0.16.0 (arm64 ZIP), stage 2 copies it to /opt/extensions/collector alongside the connector binary
  • collector.yaml: OTLP receiver on localhost:4317/4318, exports to otel-collector.c1.internal:4317 with insecure_skip_verify
  • GoReleaser template: adds collector.yaml as extra_files for Docker build context
  • Release workflow: copies collector.yaml into caller build context during Lambda config generation

Dependencies

  • ductone/c1 branch gontzess/otel-col-ext-lambda — sets BATON_OTEL_COLLECTOR_ENDPOINT=localhost:4317 on Lambda functions
  • baton-github-test branch gontzess/otel-col-ext-lambda — points release at this workflow branch for testing

Add the opentelemetry-lambda collector extension to Lambda connector
images via a multi-stage Docker build. The extension runs as a sidecar
process in the Lambda execution environment, receiving OTLP telemetry
on localhost and forwarding it to the central collector. This ensures
telemetry is flushed reliably during Lambda shutdown or crashes.

Changes:
- Dockerfile template: multi-stage build downloads otel-lambda collector
  extension v0.16.0 (arm64) and embeds it at /opt/extensions/collector
- collector.yaml: OTLP receiver on localhost, exports to central collector
- GoReleaser template: add collector.yaml as extra_files for Docker context
- Release workflow: copy collector.yaml into caller build context
GoReleaser detected collector.yaml as an untracked file in the caller
repo. Move it to the _generated dir alongside the Dockerfile and
reference via extra_files path outside the caller repo.
GoReleaser extra_files must be relative to workdir (the caller repo).
Copy collector.yaml into the caller repo and add it to .git/info/exclude
so GoReleaser can find it without dirtying the git state.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant