Skip to content

MeterHandle

Records metric instruments (histograms, counters, gauges).

Unlike spans, metric recordings are never sampled — every call here is meant to always count toward the aggregate.

interface MeterHandle

Implemented byNoopMeterHandle, OtelMeterHandle
SourceTelemetry/MeterHandle.php
MethodDescription
[`addCounter(string $name, intfloat $increment = 1, array<string, mixed> $attributes = []): void`](#addcounter)
recordGauge(string $name, float $value, array<string, mixed> $attributes = []): void
recordHistogram(string $name, float $value, array<string, mixed> $attributes = []): void

abstract public function addCounter(string $name, int|float $increment = 1, array<string, mixed> $attributes = []): void

ParameterTypeDescription
$namestring
$increment`int““float`
$attributesarray``<``string``, ``mixed``>

abstract public function recordGauge(string $name, float $value, array<string, mixed> $attributes = []): void

ParameterTypeDescription
$namestring
$valuefloat
$attributesarray``<``string``, ``mixed``>

abstract public function recordHistogram(string $name, float $value, array<string, mixed> $attributes = []): void

ParameterTypeDescription
$namestring
$valuefloat
$attributesarray``<``string``, ``mixed``>