opentelemetry.trace.sampling¶
-
class
opentelemetry.trace.sampling.
Decision
(sampled=False, attributes=None)[source]¶ Bases:
object
A sampling decision as applied to a newly-created Span.
- Parameters
sampled (
bool
) – Whether theopentelemetry.trace.Span
should be sampled.attributes (
Optional
[Mapping
[str
,Union
[str
,bool
,int
,float
,Sequence
[str
],Sequence
[bool
],Sequence
[int
],Sequence
[float
]]]]) – Attributes to add to theopentelemetry.trace.Span
.
-
class
opentelemetry.trace.sampling.
StaticSampler
(decision)[source]¶ Bases:
opentelemetry.trace.sampling.Sampler
Sampler that always returns the same decision.