Creates a new Untyped metric.
Configuration object.
Optionaldescription?: stringOptional description.
Optionallabels?: Record<string, string>Optional default labels.
Metric name.
Optionalvalue?: number | [number, number]Initial value or [value, timestamp] tuple.
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.
Gets the current value and timestamp.
[value, timestamp] tuple.
Sets the current value and timestamp.
New value or [value, timestamp] tuple.
Serializes 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.
A Prometheus Untyped metric. Used when metric type is unknown. Behaves like a Gauge.
Example