npm prom-client 13.0.0

latest releases: 15.1.2, 15.1.1, 15.1.0...
3 years ago

[13.0.0] - 2020-12-16

Breaking

  • 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.

Changed

  • fix: provide nodejs_version_info metric value after calling registry.resetMetrics() (#238)
  • fix: provide process_max_fds metric value after calling registry.resetMetrics()
  • fix: provide process_start_time_seconds metric value after calling registry.resetMetrics()
  • chore: improve performance of registry.getMetricAsPrometheusString
  • chore: refactor metrics to reduce code duplication
  • chore: replace utils.getPropertiesFromObj with Object.values
  • chore: remove unused catch bindings
  • chore: upgrade Prettier to 2.x
  • fix: startTimer returns number in typescript instead of void
  • fix: incorrect typings of `registry.getSingleMetric' (#388)
  • chore: stop testing node v13 on CI

Added

  • feat: exposed registry.registerCollector() and registry.collectors() methods in TypeScript declaration
  • Added: complete working example of a pushgateway push in example/pushgateway.js
  • feat: added support for adding labels to default metrics (#374)
  • Added CHANGELOG reminder

Don't miss a new prom-client release

NewReleases is sending notifications on new releases.