Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. SamplerInterface.php

interface SamplerInterface

This interface is used to organize sampling logic.

Hierarchy

  • interface \OpenTelemetry\SDK\Trace\SamplerInterface

Expanded class hierarchy of SamplerInterface

All classes that implement SamplerInterface

See also

https://github.com/open-telemetry/opentelemetry-specification/blob/main…

4 files declare their use of SamplerInterface
AlwaysOffSampler.php in vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOffSampler.php
AlwaysOnSampler.php in vendor/open-telemetry/sdk/Trace/Sampler/AlwaysOnSampler.php
ParentBased.php in vendor/open-telemetry/sdk/Trace/Sampler/ParentBased.php
TraceIdRatioBasedSampler.php in vendor/open-telemetry/sdk/Trace/Sampler/TraceIdRatioBasedSampler.php

File

vendor/open-telemetry/sdk/Trace/SamplerInterface.php, line 15

Namespace

OpenTelemetry\SDK\Trace
View source
interface SamplerInterface {
    
    /**
     * Returns SamplingResult.
     *
     * @param ContextInterface $parentContext Context with parent Span. The Span's SpanContext may be invalid to indicate a root span.
     * @param string $traceId TraceId of the Span to be created. It can be different from the TraceId in the SpanContext.
     *                        Typically in situations when the Span to be created starts a new Trace.
     * @param string $spanName Name of the Span to be created.
     * @param int $spanKind Span kind.
     * @param AttributesInterface $attributes Initial set of Attributes for the Span being constructed.
     * @param list<LinkInterface> $links Collection of links that will be associated with the Span to be created.
     *                     Typically, useful for batch operations.
     *                     @see https://github.com/open-telemetry/opentelemetry-specification/blob/master/specification/overview.md#links-between-spans
     * @return SamplingResult
     */
    public function shouldSample(ContextInterface $parentContext, string $traceId, string $spanName, int $spanKind, AttributesInterface $attributes, array $links) : SamplingResult;
    
    /**
     * Returns the sampler name or short description with the configuration.
     * This may be displayed on debug pages or in the logs.
     * Example: "TraceIdRatioBasedSampler{0.000100}"
     */
    public function getDescription() : string;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SamplerInterface::getDescription public function Returns the sampler name or short description with the configuration.
This may be displayed on debug pages or in the logs.
Example: &quot;TraceIdRatioBasedSampler{0.000100}&quot;
4
SamplerInterface::shouldSample public function Returns SamplingResult. 4

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal