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: v10.1.0
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: v10.1.1
Choose a head ref
  • 7 commits
  • 4 files changed
  • 4 contributors

Commits on Sep 4, 2017

  1. Copy the full SHA
    4539f5d View commit details
  2. Format changes in changelog

    siimon committed Sep 4, 2017

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    5bcfb5f View commit details
  3. Update links in changelog

    SimenB authored Sep 4, 2017

    Verified

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

Commits on Sep 23, 2017

  1. Bugfix - cannot get cluster info in node version < 6 (#153)

    The cluser.on('message') function doesn't have the worker as the first
    argument in node < 6. To do this, the official way is to check the number of
    arguments received. However, because this is using a fat arrow function (() => {}),
    the variable `arguments` is hoisted outside the scope so the actual arguments
    has a length of 5.
    
    This is best demonstrated by viewing this Babel snippet - http://bit.ly/2wbApcb
    mrsimonemms authored and siimon committed Sep 23, 2017
    Copy the full SHA
    ba93b06 View commit details

Commits on Sep 26, 2017

  1. Bugfix - update TypeScript definitions (#154)

    * add missing contentType field to Registry class
     * interval is incorrect, timeout is the correct field
     * various jsdoc fixes
     * update to latest TypeScript compiler
     * update changelog
    timrs2998 authored and SimenB committed Sep 26, 2017
    Copy the full SHA
    2d35627 View commit details
  2. Update changelog for 10.1.1

    SimenB committed Sep 26, 2017

    Verified

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

    SimenB committed Sep 26, 2017

    Verified

    This commit was signed with the committer’s verified signature.
    SimenB Simen Bekkhus
    Copy the full SHA
    426941f View commit details
Showing with 26 additions and 11 deletions.
  1. +12 −2 CHANGELOG.md
  2. +11 −6 index.d.ts
  3. +1 −1 lib/cluster.js
  4. +2 −2 package.json
14 changes: 12 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -5,9 +5,17 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p

## [Unreleased]
### Breaking
### Changed
### Added
- Support aggregating metrics across workers in a Node.js cluster.

## [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

## [10.1.0] - 2017-09-04
### Added
- Support aggregating metrics across workers in a Node.js cluster.

## [10.0.4] - 2017-08-22
### Changed
@@ -68,7 +76,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/) and this p
- Creating metrics with one argument per parameter - use object literals instead.


[Unreleased]: https://github.com/siimon/prom-client/compare/v10.0.4...HEAD
[Unreleased]: https://github.com/siimon/prom-client/compare/v10.1.1...HEAD
[10.1.0]: https://github.com/siimon/prom-client/compare/v10.1.0...v10.1.1
[10.1.0]: https://github.com/siimon/prom-client/compare/v10.0.4...v10.1.0
[10.0.4]: https://github.com/siimon/prom-client/compare/v10.0.3...v10.0.4
[10.0.3]: https://github.com/siimon/prom-client/compare/v10.0.2...v10.0.3
[10.0.2]: https://github.com/siimon/prom-client/compare/v10.0.1...v10.0.2
17 changes: 11 additions & 6 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -50,7 +50,7 @@ export class Registry {

/**
* Set static labels to every metric emitted by this registry
* @param object of name/value pairs:
* @param labels of name/value pairs:
* { defaultLabel: "value", anotherLabel: "value 2" }
*/
setDefaultLabels(labels: Object): void;
@@ -61,6 +61,11 @@ export class Registry {
*/
getSingleMetricAsString(name: string): string;

/**
* Gets the Content-Type of the metrics for use in the response headers.
*/
contentType: string;

/**
* Merge registers
* @param registers The registers you want to merge together
@@ -77,7 +82,7 @@ export class AggregatorRegistry extends Registry {
/**
* Gets aggregated metrics for all workers. The optional callback and
* returned Promise resolve with the same value; either may be used.
* @param {Function?} callback (err, metrics) => any
* @param {Function?} cb (err, metrics) => any
* @return {Promise<string>} Promise that resolves with the aggregated
* metrics.
*/
@@ -592,7 +597,7 @@ export function exponentialBuckets(
): number[];

export interface DefaultMetricsCollectorConfiguration {
interval?: number;
timeout?: number;
register?: Registry;
}

@@ -607,11 +612,11 @@ export function collectDefaultMetrics(

/**
* Configure default metrics
* @param interval The interval how often the default metrics should be probed
* @deprecated
* @param timeout The interval how often the default metrics should be probed
* @deprecated A number to defaultMetrics is deprecated, please use \`collectDefaultMetrics({ timeout: ${timeout} })\`.
* @return The setInterval number
*/
export function collectDefaultMetrics(interval: number): number;
export function collectDefaultMetrics(timeout: number): number;

export interface defaultMetrics {
/**
2 changes: 1 addition & 1 deletion lib/cluster.js
Original file line number Diff line number Diff line change
@@ -130,7 +130,7 @@ class AggregatorRegistry extends Registry {

if (cluster.isMaster) {
// Listen for worker responses to requests for local metrics
cluster.on('message', (worker, message) => {
cluster.on('message', function(worker, message) {
if (arguments.length === 2) {
// pre-Node.js v6.0
message = worker;
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "prom-client",
"version": "10.1.0",
"version": "10.1.1",
"description": "Client for prometheus",
"main": "index.js",
"files": [
@@ -39,7 +39,7 @@
"lint-staged": "^4.0.0",
"lolex": "^1.6.0",
"prettier": "1.5.2",
"typescript": "^2.0.3"
"typescript": "^2.5.2"
},
"dependencies": {
"tdigest": "^0.1.1"