interface IMetricsService
Since 0.2.0

Metrics service resolved via ctx.services.get<IMetricsService>('metrics').

Methods

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.

summary(
name: string,
options?: MetricOptions
): ISummary

Gets or creates a summary.

get(name: string): IMetric | undefined

Gets a metric by name.

Usage

import { type IMetricsService } from "common/src/index.ts";