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

Breadcrumb

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

function SpanInterface::addLink

Records a link to another `SpanContext`.

Adding links at span creation via {@link SpanBuilderInterface::addLink()} is preferred to calling {@link SpanInterface::addLink()} later, for contexts that are available during span creation, because head sampling decisions can only consider information present during span creation.

Parameters

SpanContextInterface $context span context to link:

iterable $attributes attributes to associate with the link:

Return value

SpanInterface this span

See also

https://opentelemetry.io/docs/specs/otel/trace/api/#add-link

1 method overrides SpanInterface::addLink()
NonRecordingSpan::addLink in vendor/open-telemetry/api/Trace/NonRecordingSpan.php
Records a link to another `SpanContext`.

File

vendor/open-telemetry/api/Trace/SpanInterface.php, line 81

Class

SpanInterface

Namespace

OpenTelemetry\API\Trace

Code

public function addLink(SpanContextInterface $context, iterable $attributes = []) : SpanInterface;

API Navigation

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