mirror of
https://github.com/open-telemetry/opentelemetry-python-contrib.git
synced 2025-07-30 21:56:07 +08:00
Align sampling specs in SDK (#1034)
This commit is contained in:
@ -247,7 +247,7 @@ def _get_sampling_rate(span):
|
||||
return (
|
||||
span.sampler.rate
|
||||
if ctx.trace_flags.sampled
|
||||
and isinstance(span.sampler, sampling.ProbabilitySampler)
|
||||
and isinstance(span.sampler, sampling.TraceIdRatioBased)
|
||||
else None
|
||||
)
|
||||
|
||||
|
@ -498,7 +498,7 @@ class TestDatadogSpanExporter(unittest.TestCase):
|
||||
is_remote=False,
|
||||
trace_flags=trace_api.TraceFlags(trace_api.TraceFlags.SAMPLED),
|
||||
)
|
||||
sampler = sampling.ProbabilitySampler(0.5)
|
||||
sampler = sampling.TraceIdRatioBased(0.5)
|
||||
|
||||
span = trace.Span(
|
||||
name="sampled", context=context, parent=None, sampler=sampler
|
||||
|
Reference in New Issue
Block a user