Align sampling specs in SDK (#1034)

This commit is contained in:
Leighton Chen
2020-08-31 12:07:32 -07:00
committed by GitHub
parent 02d48caf17
commit cec9b5508c
2 changed files with 2 additions and 2 deletions

View File

@ -247,7 +247,7 @@ def _get_sampling_rate(span):
return ( return (
span.sampler.rate span.sampler.rate
if ctx.trace_flags.sampled if ctx.trace_flags.sampled
and isinstance(span.sampler, sampling.ProbabilitySampler) and isinstance(span.sampler, sampling.TraceIdRatioBased)
else None else None
) )

View File

@ -498,7 +498,7 @@ class TestDatadogSpanExporter(unittest.TestCase):
is_remote=False, is_remote=False,
trace_flags=trace_api.TraceFlags(trace_api.TraceFlags.SAMPLED), trace_flags=trace_api.TraceFlags(trace_api.TraceFlags.SAMPLED),
) )
sampler = sampling.ProbabilitySampler(0.5) sampler = sampling.TraceIdRatioBased(0.5)
span = trace.Span( span = trace.Span(
name="sampled", context=context, parent=None, sampler=sampler name="sampled", context=context, parent=None, sampler=sampler