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

Breadcrumb

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

class NoopSpanBuilder

Hierarchy

  • class \OpenTelemetry\API\Trace\NoopSpanBuilder implements \OpenTelemetry\API\Trace\SpanBuilderInterface

Expanded class hierarchy of NoopSpanBuilder

File

vendor/open-telemetry/api/Trace/NoopSpanBuilder.php, line 11

Namespace

OpenTelemetry\API\Trace
View source
final class NoopSpanBuilder implements SpanBuilderInterface {
    private ContextInterface|false|null $parentContext = null;
    public function __construct(ContextStorageInterface $contextStorage) {
    }
    public function setParent(ContextInterface|false|null $context) : SpanBuilderInterface {
        $this->parentContext = $context;
        return $this;
    }
    public function addLink(SpanContextInterface $context, iterable $attributes = []) : SpanBuilderInterface {
        return $this;
    }
    public function setAttribute(string $key, mixed $value) : SpanBuilderInterface {
        return $this;
    }
    public function setAttributes(iterable $attributes) : SpanBuilderInterface {
        return $this;
    }
    public function setStartTimestamp(int $timestampNanos) : SpanBuilderInterface {
        return $this;
    }
    public function setSpanKind(int $spanKind) : SpanBuilderInterface {
        return $this;
    }
    public function startSpan() : SpanInterface {
        $parentContext = Context::resolve($this->parentContext, $this->contextStorage);
        $span = Span::fromContext($parentContext);
        if ($span->isRecording()) {
            $span = Span::wrap($span->getContext());
        }
        return $span;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
NoopSpanBuilder::$parentContext private property
NoopSpanBuilder::addLink public function Overrides SpanBuilderInterface::addLink
NoopSpanBuilder::setAttribute public function Overrides SpanBuilderInterface::setAttribute
NoopSpanBuilder::setAttributes public function Overrides SpanBuilderInterface::setAttributes
NoopSpanBuilder::setParent public function Sets the parent `Context`. Overrides SpanBuilderInterface::setParent
NoopSpanBuilder::setSpanKind public function @psalm-param SpanKind::KIND_* $spanKind Overrides SpanBuilderInterface::setSpanKind
NoopSpanBuilder::setStartTimestamp public function Sets an explicit start timestamp for the newly created {The provided *$timestamp* is assumed to be in nanoseconds. Overrides SpanBuilderInterface::setStartTimestamp
NoopSpanBuilder::startSpan public function Starts and returns a new {
The user _MUST_ manually end the span by calling {
This method does _NOT_ automatically install the span into the current context.
The user is responsible for calling {
Overrides SpanBuilderInterface::startSpan
NoopSpanBuilder::__construct public function

API Navigation

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