Optionaloptions: MetricsServiceOptionsGets all registered metric names.
Array of metric names
Gets or creates a counter.
Metric name
Optionaloptions: MetricOptions
Optional configuration
The counter instance
Gets or creates a gauge.
Metric name
Optionaloptions: MetricOptions
Optional configuration
The gauge instance
Gets a metric by name.
Metric name
The metric, or undefined if not found
Gets or creates a histogram.
Metric name
Optionaloptions: MetricOptions
Optional configuration
The histogram instance
Registers a metric directly (for declarative registration).
Metric name
Metric configuration
The created metric
Renders all metrics in Prometheus text format.
The Prometheus exposition format string
Takes a snapshot of all metrics for rendering.
Array of metric snapshots
Gets or creates a summary.
Metric name
Optionaloptions: MetricOptions
Optional configuration
The summary instance
The metrics service — provides factory methods for creating metrics and rendering them in Prometheus format.