prom-client

Prometheus client for node.js

APACHE-2.0 License

Downloads
9.6M
Stars
3K
Committers
107

Bot releases are hidden (Show)

prom-client - v15.1.2 Latest Release

Published by SimenB 6 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v15.1.1...v15.1.2

prom-client - v15.1.1

Published by SimenB 7 months ago

What's Changed

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v15.1.0...v15.1.1

prom-client - v15.1.0

Published by SimenB 10 months ago

Changed

  • remove unnecessary loop from osMemoryHeapLinux
  • Improve performance of hashObject by using pre-sorted array of label names
  • Fix type of collectDefaultMetrics.metricsList

Added

  • Allow Pushgateway to now require job names for compatibility with Gravel Gateway.
  • Allow histogram.startTime() to be used with exemplars.

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v15.0.0...v15.1.0

prom-client - v15.0.0

Published by SimenB about 1 year ago

Added

  • Support for OpenMetrics and Exemplars

Breaking

  • drop support for Node.js versions 10, 12, 14, 17 and 19

Changed

  • Refactor histogram internals and provide a fast path for rendering metrics to Prometheus strings when there are many labels shared across different values.
  • Disable custom content encoding for pushgateway delete requests in order to avoid failures from the server when using Content-Encoding: gzip header.
  • Refactor escapeString helper in lib/registry.js to improve performance and avoid an unnecessarily complex regex.
  • Cleanup code and refactor to be more efficient
  • Correct TS types for working with OpenMetrics
  • Updated Typescript and Readme docs for setToCurrentTime() to reflect units as seconds.
  • Do not ignore error if request to pushgateway fails
  • Make sure to reject the request to pushgateway if it times out

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.2.0...v15.0.0

prom-client - v15.0.0-1

Published by SimenB over 1 year ago

What's Changed

  • fix: correct exemplar formating (#556) 4a800f4
  • perf: improve performance of rendering metrics to Prometheus string (#549) a38aa2b
  • fix: Disable content encoding for pushgateway delete requests (#551) 0f872ff

Full Changelog: https://github.com/siimon/prom-client/compare/v15.0.0-0...v15.0.0-1

prom-client - v15.0.0-0

Published by SimenB over 1 year ago

What's Changed

  • Add openmetrics and exemplars support (#544) by @voltbit & @karlodwyer

Breaking changes

  • drop support for Node.js versions 10, 12 and 17

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.2.0...v15.0.0-0

prom-client - v14.2.0

Published by SimenB over 1 year ago

Changed

  • Refactor getMetricAsPrometheusString method in the Registry class to use Array.prototype.join
    instead of loop of string concatenations.
  • Also use Array.prototype.map, and object spread instead of an explicit for loop
  • changed: updated the sample output in example/default-metrics.js
  • summary metrics now has a pruneAgedBuckets config parameter
    to remove entries without any new values in the last maxAgeSeconds.
    Default is false (old behavior)

Added

  • Add get method to type definitions of metric classes

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.1.1...v14.2.0

prom-client - v14.1.1

Published by SimenB almost 2 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.1.0...v14.1.1

prom-client - v14.1.0

Published by SimenB about 2 years ago

Changed

  • types: converted all the generic Metric types to be optional

  • The done() functions returned by gauge.startTimer() and
    summary.startTimer() now return the timed duration. Histograms already had
    this behavior.

  • types: fixed type for registry.getMetricsAsArray()

  • Improve performance of gague.inc() and gauge.dec() by calling hashObject() once.

Added

  • The processResources metric was added, which keeps a track of all sorts of
    active resources. It consists of the following gauges:

    • nodejs_active_resources - Number of active resources that are currently
      keeping the event loop alive, grouped by async resource type.
    • nodejs_active_resources_total - Total number of active resources.
      It is supposed to provide the combined result of the processHandles and
      processRequests metrics along with information about any other types of
      async resources that these metrics do not keep a track of (like timers).
  • Support gzipped pushgateway requests

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.0.1...v14.1.0

prom-client - v14.0.1

Published by SimenB almost 3 years ago

What's Changed

New Contributors

Full Changelog: https://github.com/siimon/prom-client/compare/v14.0.0...v14.0.1

prom-client - v14.0.0

Published by zbjornson about 3 years ago

Breaking

  • changed: linearBuckets does not propagate rounding errors anymore. Fewer bucket bounds will be affected by rounding errors. Histogram bucket labels may change. 6f1f3b2

  • changed: The push gateway methods pushAdd(), push() and delete() now return Promises instead of accepting a callback:

    // Old:
    gateway.pushAdd({ jobName: 'test' }, (err, resp, body) => {});
    // New:
    gateway
      .pushAdd({ jobName: 'test' })
      .then(({ resp, body }) => {})
      .catch(err => {});
    // or
    const { resp, body } = await gateway.pushAdd({ jobName: 'test' });
    

    f177b1f

  • changed: The default nodejs_eventloop_lag_* metrics are now reset every time they are observed. This prevents these metrics from "stabilizing" over a long period of time and becoming insensitive to small changes. For more info, see
    #370. 0f444cd

Changed

  • Add missing await/thens to examples. 074f339
  • Add missing type declaration for client.contentType. 3b66641
  • Modernize some label processing code. c9bf1d8
prom-client - v13.2.0

Published by zbjornson about 3 years ago

Changed

  • Don't add event listener to process if cluster module is not used.
  • fix: set labels for default memory metrics on linux.
  • fix: fix DEP0152 deprecation warning in Node.js v16+.
  • fix: Set aggregation mode for newer event loop metrics. (Fixes #418)
  • Improve performance of/reduce memory allocations in Gauge.

Added

  • feat: added zero() to Histogram for setting the metrics for a given label combination to zero
  • fix: allow Gauge.inc/dec(0) without defaulting to 1
prom-client - v13.1.0

Published by zbjornson over 3 years ago

[13.1.0] - 2021-01-24

Changed

  • fix: push client attempting to write Promise (fixes #390)
  • types: improve type checking of labels
  • fix: Summary#observe should throw when adding additional labels to labelset (fixes #262)

Added

  • feat: added the ability to pass labels as an object to labels() and remove()
  • Added: More examples with commented output
prom-client - 13.0.0

Published by siimon almost 4 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
prom-client - 12.0.0

Published by siimon over 4 years ago

Breaking

  • Dropped support for end-of-life Node.js versions 6.x and 8.x
  • Dropped the previously deprecated support for positional parameters in
    constructors, only the config object forms remain.
  • Default metrics are collected on scrape of metrics endpoint, not on an
    interval. The timeout option to collectDefaultMetrics(conf) is no longer
    supported or needed, and the function no longer returns a Timeout object.

Changed

  • chore: remove ignored package-lock.json
  • fix: process_max_fds is process limit, not OS (#314)
  • Changed Metric labelNames & labelValues in TypeScript declaration to a generic type T extends string, instead of string
  • Lazy-load Node.js Cluster module to fix Passenger support (#293)
  • fix: avoid mutation bug in registry.getMetricsAsJSON()
  • fix: improve performance of registry.getMetrics*
  • End function of histogram startTimer, when invoked returns the number of seconds
  • chore: reindent package.json
  • chore: correct var name in processStartTime
  • chore: add test for process_start_time_seconds
  • chore: spelling corrections in README

Added

  • feat: implement GC metrics collection without native(C++) modules.
  • faet: implement advanced event loop monitoring
prom-client - 11.5.2

Published by SimenB over 5 years ago

Changed

  • fix: avoid mutation bug in registry
prom-client - 11.5.1

Published by SimenB over 5 years ago

Changed

  • fix: guard against missing constructor
prom-client - 11.5.0

Published by SimenB over 5 years ago

Added

  • Added timestamps toggle to collectDefaultMetrics options
  • Export validateMetricName
prom-client - 11.4.0

Published by SimenB over 5 years ago

Added

  • nodejs_active_handles metric to the collectDefaultMetrics(). Unlike nodejs_active_handles_total it split count of active handles by type.
  • nodejs_active_requests metric to the collectDefaultMetrics(). Unlike nodejs_active_requests_total it split count of active requests by type.
prom-client - 11.1.3

Published by SimenB over 5 years ago

Changed

  • Fixed performance by avoiding Object.assign on hot paths, as well as
    mutating objects when appropriate.
Package Rankings
Top 0.66% on Npmjs.org
Top 8.17% on Proxy.golang.org
Badges
Extracted from project README
Actions Status