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
Namespace
OpenTelemetry\API\TraceCode
public function addLink(SpanContextInterface $context, iterable $attributes = []) : SpanInterface;