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

Breadcrumb

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

function Span::checkForDroppedElements

1 call to Span::checkForDroppedElements()
Span::end in vendor/open-telemetry/sdk/Trace/Span.php
@inheritDoc

File

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

Class

Span

Namespace

OpenTelemetry\SDK\Trace

Code

private function checkForDroppedElements() : void {
    $spanData = $this->toSpanData();
    
    //@todo could be optimized to reduce overhead of multiple calls
    $droppedLinkAttributes = 0;
    $droppedEventAttributes = 0;
    array_map(function (EventInterface $event) use (&$droppedEventAttributes) {
        $droppedEventAttributes += $event->getAttributes()
            ->getDroppedAttributesCount();
    }, $spanData->getEvents());
    array_map(function (LinkInterface $link) use (&$droppedLinkAttributes) {
        $droppedLinkAttributes += $link->getAttributes()
            ->getDroppedAttributesCount();
    }, $spanData->getLinks());
    if ($spanData->getTotalDroppedLinks() || $spanData->getTotalDroppedEvents() || $spanData->getAttributes()
        ->getDroppedAttributesCount() || $droppedEventAttributes || $droppedLinkAttributes) {
        self::logWarning('Dropped span attributes, links or events', [
            'trace_id' => $spanData->getTraceId(),
            'span_id' => $spanData->getSpanId(),
            'attributes' => $spanData->getAttributes()
                ->getDroppedAttributesCount(),
            'links' => $spanData->getTotalDroppedLinks(),
            'link_attributes' => $droppedLinkAttributes,
            'events' => $spanData->getTotalDroppedEvents(),
            'event_attributes' => $droppedEventAttributes,
        ]);
    }
}
RSS feed
Powered by Drupal