index = $index; $this->value = $value; $this->timestamp = $timestamp; $this->attributes = $attributes; $this->traceId = $traceId; $this->spanId = $spanId; } /** * @param iterable $exemplars * @return array> */ public static function groupByIndex(iterable $exemplars): array { $grouped = []; foreach ($exemplars as $exemplar) { $grouped[$exemplar->index][] = $exemplar; } return $grouped; } }