跳转到内容
简体中文

MetricsRegistry

此内容尚不支持你的语言。

Defined in: src/metrics/Metrics.ts:228

Collection of metric families bound to one ActorSystem. Pluggable exporters (PrometheusExporter) walk collect() to produce wire format; tests use the typed counter / gauge / histogram accessors directly.

clear(): void

Defined in: src/metrics/Metrics.ts:242

Wipe the registry — primarily for tests.

void


collect(): readonly MetricSample[]

Defined in: src/metrics/Metrics.ts:239

Snapshot every series as a flat list of MetricSamples.

readonly MetricSample[]


counter(name, labels?, options?): Counter

Defined in: src/metrics/Metrics.ts:234

Get-or-create a counter family. Same (name, help) returns the same family across calls; labels selects (or creates) a child series within it.

string

Readonly<Record<string, LabelValue>>

CounterOptions

Counter


gauge(name, labels?, options?): Gauge

Defined in: src/metrics/Metrics.ts:235

string

Readonly<Record<string, LabelValue>>

GaugeOptions

Gauge


histogram(name, labels?, options?): Histogram

Defined in: src/metrics/Metrics.ts:236

string

Readonly<Record<string, LabelValue>>

HistogramOptions

Histogram