Setting built-in sampler with auto-instrumentation fails with Failed to initialize custom sampler
due to it missing from entry points
#3175
Labels
bug
Something isn't working
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
OTEL_TRACES_SAMPLER
to one of the built-in sampler values, e.g.OTEL_TRACES_SAMPLER=always_off
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 befloat
notstr
), there is a mix betweenCallable
andSampler
objects in the list of built-in samplers.The text was updated successfully, but these errors were encountered: