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

Breadcrumb

  1. Drupal Core 11.1.x

Exemplar.php

Same filename in this branch
  1. 11.1.x vendor/open-telemetry/gen-otlp-protobuf/Opentelemetry/Proto/Metrics/V1/Exemplar.php

Namespace

OpenTelemetry\SDK\Metrics\Data

File

vendor/open-telemetry/sdk/Metrics/Data/Exemplar.php

View source
<?php

declare (strict_types=1);
namespace OpenTelemetry\SDK\Metrics\Data;

use OpenTelemetry\SDK\Common\Attribute\AttributesInterface;
final class Exemplar {
    public function __construct(int|string $index, float|int $value, int $timestamp, AttributesInterface $attributes, ?string $traceId, ?string $spanId) {
    }
    
    /**
     * @param iterable<Exemplar> $exemplars
     * @return array<list<Exemplar>>
     */
    public static function groupByIndex(iterable $exemplars) : array {
        $grouped = [];
        foreach ($exemplars as $exemplar) {
            $grouped[$exemplar->index][] = $exemplar;
        }
        return $grouped;
    }

}

Classes

Title Deprecated Summary
Exemplar
RSS feed
Powered by Drupal