AbstractThe metric type (e.g., 'gauge', 'counter').
Optional ReadonlydescriptionOptional metric description (used in # HELP).
Optional ReadonlylabelsDefault labels applied to all samples of this metric.
ReadonlynameThe sanitized metric name.
ReadonlytypeThe Prometheus metric type.
AbstractstringifySerializes the metric to Prometheus exposition format.
A Promise resolving to the serialized string.
StaticcleanSanitizes a metric name by removing or replacing invalid characters.
Prometheus metric names must match [a-zA-Z_:][a-zA-Z0-9_:]* This removes hyphens, parens; replaces slashes and spaces with underscores.
Optionalinput: stringThe raw metric name.
The cleaned metric name.
StaticconcatConcatenates multiple metrics into a single exposition string.
used to set the metric type
The metrics to serialize.
A Promise resolving to the combined string.
StaticlabelConverts a label object to a Prometheus label string (e.g., {foo="bar"}).
Optionallabels: Record<string, string | number>The label key-value pairs.
The formatted label string.
Base class for all Prometheus metrics. Handles common functionality like HELP/TYPE comments and label formatting.