function Span::addLink
File
-
vendor/
open-telemetry/ sdk/ Trace/ Span.php, line 148
Class
Namespace
OpenTelemetry\SDK\TraceCode
public function addLink(SpanContextInterface $context, iterable $attributes = []) : self {
if ($this->hasEnded) {
return $this;
}
if (!$context->isValid()) {
return $this;
}
if (++$this->totalRecordedLinks > $this->spanLimits
->getLinkCountLimit()) {
return $this;
}
$this->links[] = new Link($context, $this->spanLimits
->getLinkAttributesFactory()
->builder($attributes)
->build());
return $this;
}