Skip to content

MetricsCollector

Defined in: src/observability/metrics.ts:38

Pluggable metrics collector interface.

Implementations can ship metrics to Prometheus, Datadog, CloudWatch, or any other backend. The gateway pipeline records request counts, latencies, and error rates through this interface.

gauge(name, value, tags?): void

Defined in: src/observability/metrics.ts:44

Set a gauge to an absolute value.

string

number

Record<string, string>

void


histogram(name, value, tags?): void

Defined in: src/observability/metrics.ts:42

Record a histogram observation.

string

number

Record<string, string>

void


increment(name, value?, tags?): void

Defined in: src/observability/metrics.ts:40

Increment a counter by value (default 1).

string

number

Record<string, string>

void


reset(): void

Defined in: src/observability/metrics.ts:48

Reset all metrics to zero.

void


snapshot(): MetricsSnapshot

Defined in: src/observability/metrics.ts:46

Return a point-in-time snapshot of all metrics.

MetricsSnapshot