function BucketStorage::store
File
-
vendor/
open-telemetry/ sdk/ Metrics/ Exemplar/ BucketStorage.php, line 29
Class
- BucketStorage
- @internal
Namespace
OpenTelemetry\SDK\Metrics\ExemplarCode
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;
}
}