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

Breadcrumb

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

function Span::addEvent

@inheritDoc

File

vendor/open-telemetry/sdk/Trace/Span.php, line 172

Class

Span

Namespace

OpenTelemetry\SDK\Trace

Code

public function addEvent(string $name, iterable $attributes = [], ?int $timestamp = null) : self {
    if ($this->hasEnded) {
        return $this;
    }
    if (++$this->totalRecordedEvents > $this->spanLimits
        ->getEventCountLimit()) {
        return $this;
    }
    $timestamp ??= Clock::getDefault()->now();
    $eventAttributesBuilder = $this->spanLimits
        ->getEventAttributesFactory()
        ->builder($attributes);
    $this->events[] = new Event($name, $timestamp, $eventAttributesBuilder->build());
    return $this;
}
RSS feed
Powered by Drupal