Pin OTel FastAPI/httpx instrumentation to >=0.64b0 - #19
Merged
Conversation
opentelemetry-instrumentation-fastapi < 0.64b0 raises AttributeError on FastAPI >= 0.137 include_router routing (`_IncludedRouter` has no `.path`), 500-ing every CORS preflight for consumers that enable FastAPI instrumentation (took down policyengine-uk-chat in production). The upstream fix shipped in 0.64b0; pin both instrumentation packages to that floor and refresh the lock. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
Author
|
The fail-open hardening follow-up noted above is now tracked in #20. |
Extend the forward pins to opentelemetry-api/-sdk and both OTLP exporters (>=1.43.0) alongside the instrumentation floor (>=0.64b0), so consumers get a self-consistent OTel stack at the coordinated known-good release rather than a patched instrumentor over a drifting core. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #18
Problem
opentelemetry-instrumentation-fastapiand-httpxwere declared in coredependencieswith no version floor. FastAPI 0.137.0 changedinclude_routerto append a lazily-matching_IncludedRouter(no.path);opentelemetry-instrumentation-fastapi< 0.64b0 readsroute.pathon the matched route and raisesAttributeError: '_IncludedRouter' object has no attribute 'path'on CORS preflightOPTIONSrequests → unhandled 500.This took down a downstream consumer (
policyengine-uk-chat) in production — every browser preflight 500'd. It affects any consumer that enablesinstrument_fastapion FastAPI ≥ 0.137.Upstream: open-telemetry/opentelemetry-python-contrib#4699, fixed in
opentelemetry-instrumentation-fastapi0.64b0 (2026-06-24).Change
opentelemetry-instrumentation-fastapi>=0.64b0andopentelemetry-instrumentation-httpx>=0.64b0(same coordinated OTel release train — kept aligned).uv.lock: the OTel train moves0.63b1 → 0.64b0(SDK1.42.1 → 1.43.0).changelog.d/.Verification
uv lockresolves cleanly toopentelemetry-instrumentation-fastapi==0.64b0/-httpx==0.64b0.ruff format --check .andruff check .: clean.coverage run -m pytest: 123 passed against OTel 0.64b0;coverage reportmeets the 90% gate.Follow-up (not in this PR)
Per this repo's fail-open guidance, the FastAPI adapter should degrade rather than propagate a per-request instrumentor error. The crash is inside OpenTelemetry's own ASGI middleware, so that needs an adapter-level guard rather than the setup-time
try/exceptaroundinstrument_app()we have today. Worth a separate hardening issue so a future instrumentor incompatibility can't 500 live requests.