class MetricsService
implements IMetricsService
The metrics service — provides factory methods for creating metrics and rendering them in Prometheus format.
readonly
names: readonly string[]
Gets all registered metric names.
counter(name: string,options?: MetricOptions): ICounter
Gets or creates a counter.
gauge(name: string,options?: MetricOptions): IGauge
Gets or creates a gauge.
histogram(name: string,options?: MetricOptions): IHistogram
Gets or creates a histogram.
register(name: string,config: MetricConfig): IMetric
Registers a metric directly (for declarative registration).
render(): string
Renders all metrics in Prometheus text format.
snapshot(): readonly MetricSnapshot[]
Takes a snapshot of all metrics for rendering.
summary(name: string,options?: MetricOptions): ISummary
Gets or creates a summary.