Creates a new Summary.
Configuration object.
OptionalcompressInterval?: numberOptional interval controlling compression frequency.
Optionaldescription?: stringOptional description.
Optionalerror?: numberDefault absolute rank error fraction for number-only quantiles.
Optionallabels?: Record<string, string>Metric name.
Quantiles to estimate, with optional per-quantile error bounds.
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.
Observes a value, updating quantiles, sum, and count.
The observed value.
Alias for observe().
The observed value.
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 Summary metric. Tracks quantiles, sum, and count using a streaming targeted-quantile sketch.
Example