prom-client
Advanced tools
Comparing version 11.1.3 to 11.2.0
103
CHANGELOG.md
@@ -16,2 +16,13 @@ # Changelog | ||
## [11.2.0] | ||
### Changed | ||
* 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 | ||
## [11.1.3] - 2018-09-22 | ||
@@ -21,3 +32,3 @@ | ||
- 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. | ||
@@ -29,4 +40,4 @@ | ||
- 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 | ||
@@ -37,14 +48,14 @@ ## [11.1.1] - 2018-06-29 | ||
- 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 | ||
@@ -55,6 +66,6 @@ ## [11.0.0] - 2018-03-10 | ||
- 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 | ||
@@ -67,3 +78,3 @@ ## [10.2.3] - 2018-02-28 | ||
- Fixed issue that `registry.getMetricsAsJSON()` ignores registry default labels | ||
* Fixed issue that `registry.getMetricsAsJSON()` ignores registry default labels | ||
@@ -76,3 +87,3 @@ ### Added | ||
- Fixed invalid `process_virtual_memory_bytes` reported under linux | ||
* Fixed invalid `process_virtual_memory_bytes` reported under linux | ||
@@ -83,3 +94,3 @@ ## [10.2.1] - 2017-10-27 | ||
- Only resolve/reject `clusterMetrics` promise if no callback is provided | ||
* Only resolve/reject `clusterMetrics` promise if no callback is provided | ||
@@ -90,9 +101,9 @@ ## [10.2.0] - 2017-10-16 | ||
- 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 | ||
@@ -103,4 +114,4 @@ ## [10.1.1] - 2017-09-26 | ||
- 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 | ||
@@ -111,3 +122,3 @@ ## [10.1.0] - 2017-09-04 | ||
- Support aggregating metrics across workers in a Node.js cluster. | ||
* Support aggregating metrics across workers in a Node.js cluster. | ||
@@ -118,3 +129,3 @@ ## [10.0.4] - 2017-08-22 | ||
- Include invalid values in the error messages | ||
* Include invalid values in the error messages | ||
@@ -125,8 +136,8 @@ ## [10.0.3] - 2017-08-07 | ||
- 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 | ||
@@ -137,3 +148,3 @@ ## [10.0.2] - 2017-07-07 | ||
- Don't poll default metrics every single tick | ||
* Don't poll default metrics every single tick | ||
@@ -144,3 +155,3 @@ ## [10.0.1] - 2017-07-06 | ||
- Metrics should be initialized to 0 when there are no labels | ||
* Metrics should be initialized to 0 when there are no labels | ||
@@ -151,9 +162,9 @@ ## [10.0.0] - 2017-07-04 | ||
- 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 | ||
@@ -163,9 +174,9 @@ | ||
- 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` | ||
@@ -176,3 +187,3 @@ ## [9.1.1] - 2017-06-17 | ||
- Don't set timestamps for metrics that are never updated | ||
* Don't set timestamps for metrics that are never updated | ||
@@ -183,7 +194,7 @@ ## [9.1.0] - 2017-06-07 | ||
- Ability to merge registries | ||
* Ability to merge registries | ||
### Changed | ||
- Correct typedefs for object constructor of metrics | ||
* Correct typedefs for object constructor of metrics | ||
@@ -194,9 +205,9 @@ ## [9.0.0] - 2017-05-06 | ||
- 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()`. | ||
@@ -206,3 +217,3 @@ | ||
- Creating metrics with one argument per parameter - use object literals | ||
* Creating metrics with one argument per parameter - use object literals | ||
instead. | ||
@@ -209,0 +220,0 @@ |
@@ -21,3 +21,3 @@ /** | ||
} = require('./validation'); | ||
const { TDigest } = require('tdigest'); | ||
const timeWindowQuantiles = require('./timeWindowQuantiles'); | ||
@@ -64,3 +64,5 @@ class Summary { | ||
percentiles: configurePercentiles(obj.percentiles), | ||
registers: [globalRegistry] | ||
registers: [globalRegistry], | ||
maxAgeSeconds: obj.maxAgeSeconds, | ||
ageBuckets: obj.ageBuckets | ||
}; | ||
@@ -71,2 +73,5 @@ } | ||
this.maxAgeSeconds = config.maxAgeSeconds; | ||
this.ageBuckets = config.ageBuckets; | ||
this.name = config.name; | ||
@@ -84,3 +89,3 @@ this.help = config.help; | ||
labels: {}, | ||
td: new TDigest(), | ||
td: new timeWindowQuantiles(this.maxAgeSeconds, this.ageBuckets), | ||
count: 0, | ||
@@ -250,3 +255,3 @@ sum: 0 | ||
labels: labelValuePair.labels, | ||
td: new TDigest(), | ||
td: new timeWindowQuantiles(this.maxAgeSeconds, this.ageBuckets), | ||
count: 0, | ||
@@ -253,0 +258,0 @@ sum: 0 |
{ | ||
"name": "prom-client", | ||
"version": "11.1.3", | ||
"version": "11.2.0", | ||
"description": "Client for prometheus", | ||
"main": "index.js", | ||
"files": [ | ||
"lib/", | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"files": ["lib/", "index.js", "index.d.ts"], | ||
"engines": { | ||
@@ -15,6 +11,7 @@ "node": ">=6.1" | ||
"scripts": { | ||
"benchmarks": "node ./benchmarks/index.js", | ||
"test": "npm run lint && npm run compile-typescript && npm run test-unit", | ||
"lint": "eslint .", | ||
"test-unit": "jest", | ||
"compile-typescript": "tsc index.d.ts --noImplicitAny", | ||
"compile-typescript": "tsc index.d.ts --noImplicitAny --target es6", | ||
"precommit": "lint-staged" | ||
@@ -26,7 +23,3 @@ }, | ||
}, | ||
"keywords": [ | ||
"Prometheus", | ||
"Metrics", | ||
"Client" | ||
], | ||
"keywords": ["Prometheus", "Metrics", "Client"], | ||
"author": "Simon Nyberg", | ||
@@ -36,2 +29,3 @@ "license": "Apache-2.0", | ||
"devDependencies": { | ||
"@clevernature/benchmark-regression": "^1.0.0", | ||
"eslint": "^5.6.0", | ||
@@ -57,14 +51,5 @@ "eslint-plugin-node": "^7.0.1", | ||
"lint-staged": { | ||
"*.js": [ | ||
"eslint --fix", | ||
"git add" | ||
], | ||
"*.{ts,md,json,yml}": [ | ||
"prettier --write", | ||
"git add" | ||
], | ||
".{eslintrc,travis.yml}": [ | ||
"prettier --write", | ||
"git add" | ||
] | ||
"*.js": ["eslint --fix", "git add"], | ||
"*.{ts,md,json,yml}": ["prettier --write", "git add"], | ||
".{eslintrc,travis.yml}": ["prettier --write", "git add"] | ||
}, | ||
@@ -71,0 +56,0 @@ "prettier": { |
@@ -261,2 +261,19 @@ # Prometheus client for node.js [![Build Status](https://travis-ci.org/siimon/prom-client.svg?branch=master)](https://travis-ci.org/siimon/prom-client) [![Build status](https://ci.appveyor.com/api/projects/status/k2e0gwonkcee3lp9/branch/master?svg=true)](https://ci.appveyor.com/project/siimon/prom-client/branch/master) | ||
To enable the sliding window functionality for summaries you need to add | ||
`maxAgeSeconds` and `ageBuckets` to the config like this: | ||
```js | ||
const client = require('prom-client'); | ||
new client.Summary({ | ||
name: 'metric_name', | ||
help: 'metric_help', | ||
maxAgeSeconds: 600, | ||
ageBuckets: 5 | ||
}); | ||
``` | ||
The `maxAgeSeconds` will tell how old an bucket can be before it is reset and | ||
`ageBuckets` configures how many buckets we will have in our sliding window for | ||
the summary. | ||
Usage example | ||
@@ -263,0 +280,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
107471
32
2642
527
11