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.
Synopsis
Section titled “Synopsis”interface MeterHandle
| Implemented by | NoopMeterHandle, OtelMeterHandle |
| Source | Telemetry/MeterHandle.php |
Methods
Section titled “Methods”| Method | Description |
|---|---|
| [`addCounter(string $name, int | float $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 |
addCounter()
Section titled “addCounter()”abstract public function addCounter(string $name, int|float $increment = 1, array<string, mixed> $attributes = []): void
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$increment | `int“ | “float` |
$attributes | array``<``string``, ``mixed``> |
recordGauge()
Section titled “recordGauge()”abstract public function recordGauge(string $name, float $value, array<string, mixed> $attributes = []): void
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$value | float | |
$attributes | array``<``string``, ``mixed``> |
recordHistogram()
Section titled “recordHistogram()”abstract public function recordHistogram(string $name, float $value, array<string, mixed> $attributes = []): void
| Parameter | Type | Description |
|---|---|---|
$name | string | |
$value | float | |
$attributes | array``<``string``, ``mixed``> |