Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

API sets tracecontext, baggage as default global propagators #2463

Open
pellared opened this issue Feb 16, 2022 · 0 comments
Open

API sets tracecontext, baggage as default global propagators #2463

pellared opened this issue Feb 16, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@pellared
Copy link
Member

pellared commented Feb 16, 2022

propagators = []
# Single use variable here to hack black and make lint pass
environ_propagators = environ.get(
OTEL_PROPAGATORS,
"tracecontext,baggage",
)
for propagator in environ_propagators.split(","):
propagator = propagator.strip()
try:
propagators.append( # type: ignore
next( # type: ignore
iter_entry_points("opentelemetry_propagator", propagator)
).load()()
)
except Exception: # pylint: disable=broad-except
logger.exception(
"Failed to load configured propagator `%s`", propagator
)
raise
_HTTP_TEXT_FORMAT = composite.CompositePropagator(propagators) # type: ignore

This behavior is in direct conflict with the API specification:

The OpenTelemetry API MUST use no-op propagators unless explicitly configured otherwise.

I think the SDK could do that, but not the API.

Side note: I find such logic in init violating the style guide: https://google.github.io/styleguide/pyguide.html#25-global-variables

Origin: Found by @Aneurysm9 when discussing open-telemetry/opentelemetry-go#2611

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant