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

Breadcrumb

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

function BucketStorage::store

File

vendor/open-telemetry/sdk/Metrics/Exemplar/BucketStorage.php, line 29

Class

BucketStorage
@internal

Namespace

OpenTelemetry\SDK\Metrics\Exemplar

Code

public function store(int $bucket, int|string $index, float|int $value, AttributesInterface $attributes, ContextInterface $context, int $timestamp) : void {
    assert($bucket <= count($this->buckets));
    $exemplar = $this->buckets[$bucket] ??= new BucketEntry();
    $exemplar->index = $index;
    $exemplar->value = $value;
    $exemplar->timestamp = $timestamp;
    $exemplar->attributes = $attributes;
    if (($spanContext = Span::fromContext($context)->getContext())
        ->isValid()) {
        $exemplar->traceId = $spanContext->getTraceId();
        $exemplar->spanId = $spanContext->getSpanId();
    }
    else {
        $exemplar->traceId = null;
        $exemplar->spanId = null;
    }
}
RSS feed
Powered by Drupal