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

Setting built-in sampler with auto-instrumentation fails with Failed to initialize custom sampler due to it missing from entry points #3175

Closed
matej-g opened this issue Feb 15, 2023 · 1 comment · Fixed by #3176
Labels
bug Something isn't working

Comments

@matej-g
Copy link
Contributor

matej-g commented Feb 15, 2023

Previously also reported in open-telemetry/opentelemetry-operator#1468, but I believe this needs to be fixed in the SDK.

Describe your environment
Python 3.9
MacOS 12.6.2
OTEL version latest release (1.15.0/0.36b0)

Steps to reproduce

  • Set env var OTEL_TRACES_SAMPLER to one of the built-in sampler values, e.g. OTEL_TRACES_SAMPLER=always_off
  • Run any application with auto-instrumentation as instructed in https://opentelemetry.io/docs/instrumentation/python/automatic/agent-config/
  • Observe the warning message, e.g. Using default sampler. Failed to initialize custom sampler, always_off: Requested component 'always_off' not found in entry points for 'opentelemetry_traces_sampler'

What is the expected behavior?
The agent should use the built-in sampler.

What is the actual behavior?
The agent complains about the sampler missing from entry points and falls back to using the default sampler.

Additional context
I believe this should be fixed by adding the samplers to entry points in opentelemetry-sdk. Some additional code change might be necessary as well, e.g. the sampler arg does not seem to be handled correctly (should be float not str), there is a mix between Callable and Sampler objects in the list of built-in samplers.

@matej-g matej-g added the bug Something isn't working label Feb 15, 2023
@matej-g matej-g changed the title Setting built-in sampler with auto-instrumentation fails with Failed to initialize custom samplerdue to it missing from entry points Setting built-in sampler with auto-instrumentation fails with Failed to initialize custom sampler due to it missing from entry points Feb 15, 2023
@danw-mpl
Copy link

Ran into this one myself today. Hopefully that PR can go in soon. 🚀

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

Successfully merging a pull request may close this issue.

2 participants