Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: siimon/prom-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v11.2.1
Choose a base ref
...
head repository: siimon/prom-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v11.3.0
Choose a head ref
  • 9 commits
  • 25 files changed
  • 6 contributors

Commits on Dec 28, 2018

  1. chore: bump deps

    SimenB committed Dec 28, 2018

    Verified

    This commit was signed with the committer’s verified signature.
    SimenB Simen Bekkhus
    Copy the full SHA
    fade8cd View commit details

Commits on Dec 29, 2018

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    c0eb31c View commit details
  2. Verified

    This commit was signed with the committer’s verified signature.
    SimenB Simen Bekkhus
    Copy the full SHA
    ef9cf9d View commit details

Commits on Jan 21, 2019

  1. Copy the full SHA
    c2c115d View commit details

Commits on Feb 1, 2019

  1. Performance improvement (#235)

    SerayaEryn authored and SimenB committed Feb 1, 2019
    Copy the full SHA
    a1ab1de View commit details
  2. Add remove() method for handling dynamic labels (#242)

    * Add remove() method for handling dynamic labels
    
    Fixes #187
    
    * update types with remove() method
    
    * updated changelog
    lizardruss authored and siimon committed Feb 1, 2019
    Copy the full SHA
    66f45d9 View commit details

Commits on Apr 2, 2019

  1. Fix rare ERR_IPC_CHANNEL_CLOSED bug in cluster mode (#244)

    * Fix rare ERR_IPC_CHANNEL_CLOSED bug in cluster mode
    
    A cluster worker can still be in the list of workers even if its IPC channel has closed (e.g. when the worker exits abruptly). Check that its IPC channel is open before sending a message.
    
    * Remove a Node.js pre-v6 compatibility bit
    zbjornson authored and siimon committed Apr 2, 2019
    Copy the full SHA
    5d21477 View commit details
  2. Changelog for 11.3.0

    siimon committed Apr 2, 2019
    Copy the full SHA
    ebee85f View commit details
  3. 11.3.0

    siimon committed Apr 2, 2019
    Copy the full SHA
    b66755a View commit details
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -3,6 +3,7 @@ node_js:
- node
- 6
- 8
- 10
os:
- linux
- osx
111 changes: 61 additions & 50 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -13,6 +13,17 @@ project adheres to [Semantic Versioning](http://semver.org/).

### Added

## [11.3.0] - 2019-04-02

### Changed

- Check that cluster worker is still connected before attempting to query it for
metrics. (#244)

### Added

- Added a `remove()` method on each metric type, based on [Prometheus "Writing Client Libraries" section on labels](https://prometheus.io/docs/instrumenting/writing_clientlibs/#labels)

## [11.2.1]

### Breaking
@@ -21,190 +32,190 @@ project adheres to [Semantic Versioning](http://semver.org/).

### Added

* Updated types for Summary in typescript definition file
- Updated types for Summary in typescript definition file

## [11.2.0]

### Changed

* Updated child dependency `merge` patch version to remove vulnerability.
- Updated child dependency `merge` patch version to remove vulnerability.

### Added

* Added an initial `benchmark` suite which can be run with `npm run benchmarks`.
* Add support for sliding windows in Summaries
- Added an initial `benchmark` suite which can be run with `npm run benchmarks`.
- Add support for sliding windows in Summaries

## [11.1.3] - 2018-09-22

### Changed

* Fixed performance by avoiding `Object.assign` on hot paths, as well as
- Fixed performance by avoiding `Object.assign` on hot paths, as well as
mutating objects when appropriate.

## [11.1.2] - 2018-09-19

### Changed

* Allow setting Gauge values to NaN, +Inf, and -Inf
* Fixed `histogram` scrape performance by using `acc.push` instead of `acc.concat`. Fixes #216 with #219
- Allow setting Gauge values to NaN, +Inf, and -Inf
- Fixed `histogram` scrape performance by using `acc.push` instead of `acc.concat`. Fixes #216 with #219

## [11.1.1] - 2018-06-29

### Changed

* Fixed `processOpenFileDescriptors` metric when no custom config was set
- Fixed `processOpenFileDescriptors` metric when no custom config was set

## [11.1.0] - 2018-06-29

* Added ability to set a name prefix in the default metrics
- Added ability to set a name prefix in the default metrics

### Changed

* Fixed `startTimer` utility to not mutate objects passed as `startLabels`
* Fixed `Counter` to validate labels parameter of `inc()` against initial
- Fixed `startTimer` utility to not mutate objects passed as `startLabels`
- Fixed `Counter` to validate labels parameter of `inc()` against initial
labelset
* Fixed `AggregatorFactory` losing the aggregator method of metrics
- Fixed `AggregatorFactory` losing the aggregator method of metrics

## [11.0.0] - 2018-03-10

### Breaking

* Fixed `gauge.setToCurrentTime()` to use seconds instead of milliseconds
* This conforms to Prometheus
- Fixed `gauge.setToCurrentTime()` to use seconds instead of milliseconds
- This conforms to Prometheus
[best practices](https://prometheus.io/docs/practices/naming/#base-units)
* Dropped support for node 4
- Dropped support for node 4

## [10.2.3] - 2018-02-28

### Breaking

### Changed

* Fixed issue that `registry.getMetricsAsJSON()` ignores registry default labels
- Fixed issue that `registry.getMetricsAsJSON()` ignores registry default labels

### Added

## [10.2.2] - 2017-11-02

### Changed

* Fixed invalid `process_virtual_memory_bytes` reported under linux
- Fixed invalid `process_virtual_memory_bytes` reported under linux

## [10.2.1] - 2017-10-27

### Changed

* Only resolve/reject `clusterMetrics` promise if no callback is provided
- Only resolve/reject `clusterMetrics` promise if no callback is provided

## [10.2.0] - 2017-10-16

### Changed

* Don't add event listeners if cluster module is not used.
* Fixed issue with counters having extra records when using empty labels
- Don't add event listeners if cluster module is not used.
- Fixed issue with counters having extra records when using empty labels

### Added

* Added `reset` to Counter and Gauge
* Added `resetMetrics` to register to calling `reset` of all metric instances
- Added `reset` to Counter and Gauge
- Added `resetMetrics` to register to calling `reset` of all metric instances

## [10.1.1] - 2017-09-26

### Changed

* Update TypeScript definitions and JSDoc comments to match JavaScript sources
* Fix lexical scope of `arguments` in cluster code
- Update TypeScript definitions and JSDoc comments to match JavaScript sources
- Fix lexical scope of `arguments` in cluster code

## [10.1.0] - 2017-09-04

### Added

* Support aggregating metrics across workers in a Node.js cluster.
- Support aggregating metrics across workers in a Node.js cluster.

## [10.0.4] - 2017-08-22

### Changed

* Include invalid values in the error messages
- Include invalid values in the error messages

## [10.0.3] - 2017-08-07

### Added

* Added registerMetric to definitions file
- Added registerMetric to definitions file

### Changed

* Fixed typing of DefaultMetricsCollectorConfiguration in definitions file
* Don't pass timestamps through to pushgateway by default
- Fixed typing of DefaultMetricsCollectorConfiguration in definitions file
- Don't pass timestamps through to pushgateway by default

## [10.0.2] - 2017-07-07

### Changed

* Don't poll default metrics every single tick
- Don't poll default metrics every single tick

## [10.0.1] - 2017-07-06

### Added

* Metrics should be initialized to 0 when there are no labels
- Metrics should be initialized to 0 when there are no labels

## [10.0.0] - 2017-07-04

### Breaking

* Print deprecation warning when metrics are constructed using non-objects
* Print deprecation warning when `collectDefaultMetrics` is called with a number
- Print deprecation warning when metrics are constructed using non-objects
- Print deprecation warning when `collectDefaultMetrics` is called with a number

### Added

* Ability to set default labels by registry
* Allow passing in `registry` as second argument to `collectDefaultMetrics` to
- Ability to set default labels by registry
- Allow passing in `registry` as second argument to `collectDefaultMetrics` to
use that instead of the default registry

### Changed

* Convert code base to ES2015 code (node 4)
* add engines field to package.json
* Use object shorthand
* Remove `util-extend` in favor of `Object.assign`
* Arrow functions over binding or putting `this` in a variable
* Use template strings
* `prototype` -> `class`
- Convert code base to ES2015 code (node 4)
- add engines field to package.json
- Use object shorthand
- Remove `util-extend` in favor of `Object.assign`
- Arrow functions over binding or putting `this` in a variable
- Use template strings
- `prototype` -> `class`

## [9.1.1] - 2017-06-17

### Changed

* Don't set timestamps for metrics that are never updated
- Don't set timestamps for metrics that are never updated

## [9.1.0] - 2017-06-07

### Added

* Ability to merge registries
- Ability to merge registries

### Changed

* Correct typedefs for object constructor of metrics
- Correct typedefs for object constructor of metrics

## [9.0.0] - 2017-05-06

### Added

* Support for multiple registers
* Support for object literals in metric constructors
* Timestamp support
- Support for multiple registers
- Support for object literals in metric constructors
- Timestamp support

### Changed

* Collection of default metrics is now disabled by default. Start collection by
- Collection of default metrics is now disabled by default. Start collection by
running `collectDefaultMetrics()`.

### Deprecated

* Creating metrics with one argument per parameter - use object literals
- Creating metrics with one argument per parameter - use object literals
instead.

[unreleased]: https://github.com/siimon/prom-client/compare/v10.2.2...HEAD
30 changes: 0 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
@@ -142,14 +142,6 @@ counter.inc(); // Inc with 1
counter.inc(10); // Inc with 10
```

A counter can be reset manually. This removes the label-values combinations and
initializes to 0.

```js
counter.reset();
counter.inc(); // Inc with 1 starting from 0
```

### Gauge

Gauges are similar to Counters but Gauges value can be decreased.
@@ -164,14 +156,6 @@ gauge.dec(); // Dec with 1
gauge.dec(10); // Dec with 10
```

A gauge can be reset manually. This removes the label-values combinations and
initializes to 0.

```js
gauge.reset();
gauge.inc(); // Inc with 1 starting from 0
```

There are some utilities for common use cases:

```js
@@ -233,13 +217,6 @@ xhrRequest(function(err, res) {
});
```

A Histogram can be reset manually. This removes the label-values combinations
and reinitializes the observations.

```js
histogram.reset();
```

### Summary

Summaries calculate percentiles of observed values.
@@ -295,13 +272,6 @@ xhrRequest(function(err, res) {
});
```

A Summary can be reset manually. This removes the label-values combinations and
reinitializes the observations.

```js
summary.reset();
```

### Labels

All metrics can take a labelNames property in the configuration object. All
10 changes: 6 additions & 4 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
init:
- git config --global core.autocrlf true
- git config --global core.autocrlf false

environment:
matrix:
- nodejs_version: 6
- nodejs_version: 7
- nodejs_version: 8
- nodejs_version: 9
- nodejs_version: 10
- nodejs_version: 11

install:
- ps: Install-Product node $env:nodejs_version
- npm install
- npm -g install npm
- set PATH=%APPDATA%\npm;%PATH%
- npm ci

test_script:
- node --version && npm --version
1 change: 1 addition & 0 deletions benchmarks/index.js
Original file line number Diff line number Diff line change
@@ -9,6 +9,7 @@ const benchmarks = createRegressionBenchmark(currentClient, [

benchmarks.suite('registry', require('./registry'));
benchmarks.suite('histogram', require('./histogram'));
benchmarks.suite('summary', require('./summary'));
benchmarks.run().catch(err => {
console.error(err.stack);
// eslint-disable-next-line no-process-exit
Loading