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

Breadcrumb

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

interface SpanBuilderInterface

Obtained from a {

Hierarchy

  • interface \OpenTelemetry\API\Trace\SpanBuilderInterface

Expanded class hierarchy of SpanBuilderInterface

All classes that implement SpanBuilderInterface

See also

TracerInterface} and used to construct a {@see SpanInterface}.

File

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

Namespace

OpenTelemetry\API\Trace
View source
interface SpanBuilderInterface {
    
    /**
     * Sets the parent `Context`.
     *
     * @param ContextInterface|false|null $context the parent context, null to use the
     *        current context, false to set no parent
     * @return SpanBuilderInterface this span builder
     *
     * @see https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/trace/api.md#span-creation
     */
    public function setParent(ContextInterface|false|null $context) : SpanBuilderInterface;
    public function addLink(SpanContextInterface $context, iterable $attributes = []) : SpanBuilderInterface;
    public function setAttribute(string $key, mixed $value) : SpanBuilderInterface;
    public function setAttributes(iterable $attributes) : SpanBuilderInterface;
    
    /**
     * Sets an explicit start timestamp for the newly created {@see SpanInterface}.
     * The provided *$timestamp* is assumed to be in nanoseconds.
     *
     * Defaults to the timestamp when {@see SpanBuilderInterface::startSpan} was called if not explicitly set.
     */
    public function setStartTimestamp(int $timestampNanos) : SpanBuilderInterface;
    
    /**
     * @psalm-param SpanKind::KIND_* $spanKind
     */
    public function setSpanKind(int $spanKind) : SpanBuilderInterface;
    
    /**
     * Starts and returns a new {@see SpanInterface}.
     *
     * The user _MUST_ manually end the span by calling {@see SpanInterface::end}.
     *
     * This method does _NOT_ automatically install the span into the current context.
     * The user is responsible for calling {@see SpanInterface::activate} when they wish to do so.
     */
    public function startSpan() : SpanInterface;

}

Members

Title Sort descending Modifiers Object type Summary Overrides
SpanBuilderInterface::addLink public function 1
SpanBuilderInterface::setAttribute public function 1
SpanBuilderInterface::setAttributes public function 1
SpanBuilderInterface::setParent public function Sets the parent `Context`. 1
SpanBuilderInterface::setSpanKind public function @psalm-param SpanKind::KIND_* $spanKind 1
SpanBuilderInterface::setStartTimestamp public function Sets an explicit start timestamp for the newly created {The provided *$timestamp* is assumed to be in nanoseconds. 1
SpanBuilderInterface::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 {
1

API Navigation

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