Repository navigation
opentelemetry-api: honor OTEL_PROPAGATORS set after import - #5610
BetterAndBetterII wants to merge 4 commits into
Conversation
Load the default composite propagator on first get_global_textmap() so distros can set OTEL_PROPAGATORS in configure() after the API is imported. set_global_textmap still wins if it ran first.
Pull request dashboard statusWaiting on the author · refreshed 2026-10-26 20:55 UTC Respond to 1 review item (e.g. link a commit, explain why not, ask a follow-up):
Status above doesn't look right?
|
| def tearDown(self): | ||
| environ.pop(OTEL_PROPAGATORS, None) | ||
| # pylint: disable=import-outside-toplevel | ||
| import opentelemetry.propagate # noqa: PLC0415 |
There was a problem hiding this comment.
Would this be affected if tests were run in random order?
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
|
Hi @BetterAndBetterII — just a friendly reminder that this pull request is waiting on you. The dashboard status comment has the open items and is kept current.
|
|
This PR has been automatically marked as stale because it has not had any activity for 14 days. It will be closed if no further activity occurs within 14 days of this comment. |
Description
opentelemetry.propagateassigned_HTTP_TEXT_FORMAT = _load_propagators()at import time. A distro that imports the API and then setsOTEL_PROPAGATORSinconfigure()could not override the default composite propagator.get_global_textmap()now loads propagators on first use soOTEL_PROPAGATORSis read then.set_global_textmap()still wins if it ran first.Test
opentelemetry.propagate, then setOTEL_PROPAGATORS=baggage:get_global_textmap()is baggage-only.set_global_textmap()before env still returns the explicit propagator.Fixes #4679