MediaWiki master
Wikimedia\Telemetry\SamplerInterface Interface Reference

Interface for OTEL span samplers. More...

Inherited by Wikimedia\Telemetry\ProbabilisticSampler.

Public Member Functions

 shouldSample (?SpanContext $parentSpanContext)
 Determine whether a newly created span should be sampled based on its parent span data.
 

Detailed Description

Interface for OTEL span samplers.

Since
1.43

Definition at line 8 of file SamplerInterface.php.

Member Function Documentation

◆ shouldSample()

Wikimedia\Telemetry\SamplerInterface::shouldSample ( ?SpanContext $parentSpanContext)

Determine whether a newly created span should be sampled based on its parent span data.

Parameters
SpanContext | null$parentSpanContextContext of he parent span of the newly created span, or null if the newly created span is a root span.
Returns
bool Whether the newly created span should be sampled.

Implemented in Wikimedia\Telemetry\ProbabilisticSampler.


The documentation for this interface was generated from the following file: