Repository navigation
fix(observability): read exporter headers from where OTel 1.45 keeps them - #81
Merged
Merged
Conversation
…them
CI went red on `main` without anyone changing it. Four exporter tests began
failing with:
AttributeError: 'OTLPSpanExporter' object has no attribute '_headers'
Nothing in the tree moved. `opentelemetry-exporter-otlp-proto-http` is
constrained `>=1.27` with no upper bound, so CI resolves whatever is newest, and
1.45 restructured the exporter: it grew an inner `_client` that owns the
transport, and the headers went with it. `_endpoint` stayed where it was, which
is why only the header assertions broke.
These tests reach into that private attribute on purpose — it is how they prove
a builder's environment config maps to the right wire target without opening a
socket — so the fix is to keep doing that and absorb the move. A `_headers`
helper now accepts either layout, exactly as the `_exporter` helper beside it
already absorbs a processor attribute rename.
The helper also lower-cases the names. 1.45 normalises them, and HTTP header
names are case-insensitive (RFC 9110 §5.1), so the casing a builder happens to
pass was never the property worth asserting on.
No shipped code changed; this is test-only. Verified by running the suite
against both versions: 1.44.0, which is what a current lockfile resolves, and
1.45.1, which is what CI installed when it failed. Green on both.
The underlying exposure is unchanged — an unpinned upper bound means a future
OTel release can break the build again with no commit of ours. Worth a decision
on whether to cap it, but capping on a red build would mask this rather than
fix it.
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.
What changed, and why
CI went red on
mainwithout anyone changing it. Four tests intest_exporters.pybegan failing with:Nothing in the tree moved.
opentelemetry-exporter-otlp-proto-httpis constrained>=1.27with no upper bound, so CI resolves whatever is newest — it installed 1.45.1 — and 1.45 restructured the exporter. It grew an inner_clientthat owns the transport, and the headers went with it:_endpointstayed on the exporter, which is why only the header assertions broke and the endpoint ones passed.These tests reach into that private attribute deliberately — it is how they prove a builder's environment config maps to the right wire target without opening a socket — so the fix keeps doing that and absorbs the move. A
_headershelper now accepts either layout, exactly as the_exporterhelper directly above it already absorbs a processor attribute rename.The helper also lower-cases the names. 1.45 normalises them, and HTTP header names are case-insensitive (RFC 9110 §5.1), so the casing a builder happens to pass was never the property worth asserting on.
Test-only. No shipped code changed.
How it was verified
The failure is version-dependent, so testing it on one version proves nothing. I ran the suite against both:
opentelemetry-exporter-otlp-proto-httpFull suite under 1.45.1: 950 passed, 26 skipped, 3 xfailed, exit
0.I also confirmed the mechanism rather than inferring it, by constructing an exporter under 1.45.1 and inspecting it:
Gate on this branch, checked on exit code:
ruff check .0,ruff format --check .0,mkdocs build --strict0,agentship verify --agents-dir examples0(grid 11/11, 0 over-claims).Checklist
make testpasses locally.ruff checkandruff format --checkare clean.agentship verifystill exits0, with no new over-claims.docs/capabilities/. — no public surface change.docs/CHANGELOG.mdhas an entry under## [Unreleased]. — this PR creates the section, since0.0.4was just cut.docs/decisions/. — none; the reasoning is in the helper's docstring.Anything deliberately left undone
livekit-agents, which already carries its ownopentelemetry-api<1.45bound. Worth deciding separately; I did not want to make that call inside a CI-unblocking PR.