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

Breadcrumb

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

class Span

Same name in this branch
  1. 11.1.x vendor/open-telemetry/sdk/Trace/Span.php \OpenTelemetry\SDK\Trace\Span
  2. 11.1.x vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Trace/V1/Span.php \Opentelemetry\Proto\Trace\V1\Span

Hierarchy

  • class \OpenTelemetry\API\Trace\Span implements \OpenTelemetry\API\Trace\SpanInterface

Expanded class hierarchy of Span

6 files declare their use of Span
AutoRootSpan.php in vendor/open-telemetry/sdk/Trace/AutoRootSpan.php
BucketStorage.php in vendor/open-telemetry/sdk/Metrics/Exemplar/BucketStorage.php
ReadableLogRecord.php in vendor/open-telemetry/sdk/Logs/ReadableLogRecord.php
TraceContextPropagator.php in vendor/open-telemetry/api/Trace/Propagation/TraceContextPropagator.php
WithSampledTraceExemplarFilter.php in vendor/open-telemetry/sdk/Metrics/Exemplar/ExemplarFilter/WithSampledTraceExemplarFilter.php

... See full list

12 string references to 'Span'
FieldFilteredMarkup::allowedTags in core/lib/Drupal/Core/Field/FieldFilteredMarkup.php
Returns the allowed tag list.
FieldPluginBase::elementLabelType in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Returns an HTML element for the label based upon the field's element type.
FieldPluginBase::elementType in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Returns an HTML element based upon the field's element type.
FieldPluginBase::renderTrimText in core/modules/views/src/Plugin/views/field/FieldPluginBase.php
Trims the field down to the specified length.
locale_string_is_safe in core/modules/locale/locale.module
Check that a string is safe to be added or imported as a translation.

... See full list

File

vendor/open-telemetry/api/Trace/Span.php, line 12

Namespace

OpenTelemetry\API\Trace
View source
abstract class Span implements SpanInterface {
    private static ?self $invalidSpan = null;
    
    /** @inheritDoc */
    public static final function fromContext(ContextInterface $context) : SpanInterface {
        return $context->get(ContextKeys::span()) ?? self::getInvalid();
    }
    
    /** @inheritDoc */
    public static final function getCurrent() : SpanInterface {
        return self::fromContext(Context::getCurrent());
    }
    
    /** @inheritDoc */
    public static final function getInvalid() : SpanInterface {
        if (null === self::$invalidSpan) {
            self::$invalidSpan = new NonRecordingSpan(SpanContext::getInvalid());
        }
        return self::$invalidSpan;
    }
    
    /** @inheritDoc */
    public static final function wrap(SpanContextInterface $spanContext) : SpanInterface {
        if (!$spanContext->isValid()) {
            return self::getInvalid();
        }
        return new NonRecordingSpan($spanContext);
    }
    
    /** @inheritDoc */
    public final function activate() : ScopeInterface {
        return Context::getCurrent()->withContextValue($this)
            ->activate();
    }
    
    /** @inheritDoc */
    public final function storeInContext(ContextInterface $context) : ContextInterface {
        if (LocalRootSpan::isLocalRoot($context)) {
            $context = LocalRootSpan::store($context, $this);
        }
        return $context->with(ContextKeys::span(), $this);
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title Overrides
Span::$invalidSpan private static property
Span::activate final public function @inheritDoc Overrides ImplicitContextKeyedInterface::activate
Span::fromContext final public static function @inheritDoc Overrides SpanInterface::fromContext
Span::getCurrent final public static function @inheritDoc Overrides SpanInterface::getCurrent
Span::getInvalid final public static function @inheritDoc Overrides SpanInterface::getInvalid
Span::storeInContext final public function @inheritDoc Overrides ImplicitContextKeyedInterface::storeInContext
Span::wrap final public static function @inheritDoc Overrides SpanInterface::wrap
SpanInterface::addEvent public function 1
SpanInterface::addLink public function Records a link to another `SpanContext`. 1
SpanInterface::end public function 1
SpanInterface::getContext public function 1
SpanInterface::isRecording public function 1
SpanInterface::recordException public function 1
SpanInterface::setAttribute public function Adding attributes at span creation is preferred to calling setAttribute later, as samplers can only consider information
already present during span creation
1
SpanInterface::setAttributes public function An attribute with a null key will be dropped, and an attribute with a null value will be dropped but also remove any existing
attribute with the same key.
1
SpanInterface::setStatus public function @psalm-param StatusCode::STATUS_* $code 1
SpanInterface::updateName public function 1
RSS feed
Powered by Drupal