function AlwaysOffSampler::shouldSample
Returns false because we never want to sample.
Overrides SamplerInterface::shouldSample
File
-
vendor/
open-telemetry/ sdk/ Trace/ Sampler/ AlwaysOffSampler.php, line 27
Class
- AlwaysOffSampler
- This implementation of the SamplerInterface always skips record. Example: ``` use OpenTelemetry\Sdk\Trace\AlwaysOffSampler; $sampler = new AlwaysOffSampler(); ```
Namespace
OpenTelemetry\SDK\Trace\SamplerCode
public function shouldSample(ContextInterface $parentContext, string $traceId, string $spanName, int $spanKind, AttributesInterface $attributes, array $links) : SamplingResult {
$parentSpan = Span::fromContext($parentContext);
$parentSpanContext = $parentSpan->getContext();
$traceState = $parentSpanContext->getTraceState();
return new SamplingResult(SamplingResult::DROP, [], $traceState);
}