function Span::checkForDroppedElements
1 call to Span::checkForDroppedElements()
File
-
vendor/
open-telemetry/ sdk/ Trace/ Span.php, line 337
Class
Namespace
OpenTelemetry\SDK\TraceCode
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,
]);
}
}