Skip to content

fix(otel): align dependencies with ADOT layer#545

Merged
zhongkechen merged 2 commits into
mainfrom
codex/resolve-latest-adot-layer
Jul 17, 2026
Merged

fix(otel): align dependencies with ADOT layer#545
zhongkechen merged 2 commits into
mainfrom
codex/resolve-latest-adot-layer

Conversation

@zhongkechen

@zhongkechen zhongkechen commented Jul 17, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Resolve and validate the latest regional ADOT Python Lambda layer before cloud deployment.
  • Pass the layer ARN into the generated SAM template instead of pinning a regional layer version in the examples catalog.
  • Cap opentelemetry-api, opentelemetry-sdk, and opentelemetry-exporter-otlp at 1.42.1, matching the stable OTel family bundled by ADOT 0.18.0 / layer :33.
  • Document the temporary compatibility ceiling.

Root cause
OpenTelemetry 1.44.0 removed the deprecated Events API. ADOT still imports opentelemetry._events; when the function bundle supplies OTel 1.44.0 ahead of the Lambda layer on sys.path, ADOT initialization fails while importing _OTEL_PYTHON_EVENT_LOGGER_PROVIDER. Lambda continues with a proxy tracer provider, so spans are non-recording and never reach X-Ray.

Updating only the layer to :33 still reproduced both X-Ray failures because that ADOT release predates OTel 1.44.0. The dependency ceiling keeps the application and layer on the compatible 1.42.1 / 0.63b1 family.

Testing

  • hatch run dev-otel:test (53 passed)
  • hatch run dev-examples:test (79 passed, 2 skipped cloud-only X-Ray tests)
  • hatch run examples:build resolves OTel API, SDK, exporters, and proto to 1.42.1, with semantic conventions 0.63b1
  • hatch fmt --check
  • Cloud example-test matrix passes on Python 3.11, 3.12, 3.13, and 3.14, including both X-Ray span assertions

@zhongkechen
zhongkechen force-pushed the codex/resolve-latest-adot-layer branch from 3c2421c to b12396f Compare July 17, 2026 06:00
@zhongkechen zhongkechen changed the title Resolve the latest ADOT layer for example deployments ci: resolve latest ADOT layer Jul 17, 2026
@zhongkechen zhongkechen changed the title ci: resolve latest ADOT layer fix(otel): align dependencies with ADOT layer Jul 17, 2026
@zhongkechen
zhongkechen marked this pull request as ready for review July 17, 2026 06:22
@zhongkechen zhongkechen self-assigned this Jul 17, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are we going to revert the capped version change after issue is fixed?
What happens if there is a new version of ADOT layer based off newer version of Otel and we try to run it against older version of Otel (1.42.1)?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure. Let's see how it behaves when new version of ADOT is released

@zhongkechen
zhongkechen merged commit 6331578 into main Jul 17, 2026
13 checks passed
@zhongkechen
zhongkechen deleted the codex/resolve-latest-adot-layer branch July 17, 2026 17:38
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.

2 participants