prom-client
Advanced tools
Changelog
[13.1.0] - 2021-01-24
labels()
and remove()
Changelog
[13.0.0] - 2020-12-16
changed: The following functions are now async (return a promise):
registry.metrics()
registry.getMetricsAsJSON()
registry.getMetricsAsArray()
registry.getSingleMetricAsString()
If your metrics server has a line like res.send(register.metrics())
, you
should change it to res.send(await register.metrics())
.
Additionally, all metric types now accept an optional collect
function,
which is called when the metric's value should be collected and within which
you should set the metric's value. You should provide a collect
function for
point-in-time metrics (e.g. current memory usage, as opposed to HTTP request
durations that are continuously logged in a histogram).
changed: register.clusterMetrics()
no longer accepts a callback; it only
returns a promise.
removed: v12.0.0 added the undocumented functions registry.registerCollector
and registry.collectors()
. These have been removed. If you were using them,
you should instead provide a collect
function as described above.
registry.resetMetrics()
(#238)registry.resetMetrics()
registry.resetMetrics()
registry.getMetricAsPrometheusString
utils.getPropertiesFromObj
with Object.values
catch
bindingsnumber
in typescript instead of void
registry.registerCollector()
and registry.collectors()
methods in TypeScript declarationexample/pushgateway.js