Skip to content

ReceivedMetric

A metric decoded from an OTLP ExportMetricsServiceRequest by OtlpDecoder.

$type is one of 'gauge', 'sum', 'histogram' — the only three shapes TelemetryMiddleware emits. Other OTLP metric types (exponential histogram, summary) are skipped by the decoder rather than represented here.

final class ReceivedMetric

SourceReceivedMetric.php
PropertyTypeDescription
$dataPointsarrayreadonly.
$namestringreadonly.
$resourceAttributesarrayreadonly.
$typestringreadonly.

public function __construct(string $name, 'gauge'|'sum'|'histogram' $type, array<ReceivedDataPoint> $dataPoints, array<string, mixed> $resourceAttributes): mixed

ParameterTypeDescription
$namestring
$type`‘gauge’“'sum'
$dataPointsarray``<ReceivedDataPoint>
$resourceAttributesarray``<``string``, ``mixed``>

Returns mixed