Socket
Socket
Sign inDemoInstall

prom-client

Package Overview
Dependencies
Maintainers
3
Versions
84
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prom-client - npm Package Compare versions

Comparing version 15.1.0 to 15.1.1

1

lib/counter.js

@@ -88,2 +88,3 @@ /**

updateExemplar(exemplarLabels, value, hash) {
if (exemplarLabels === this.defaultExemplarLabelSet) return;
if (!isObject(this.hashMap[hash].exemplar)) {

@@ -90,0 +91,0 @@ this.hashMap[hash].exemplar = new Exemplar();

37

lib/histogram.js

@@ -29,9 +29,2 @@ /**

if (config.enableExemplars) {
this.enableExemplars = true;
this.observe = this.observeWithExemplar;
} else {
this.observe = this.observeWithoutExemplar;
}
for (const label of this.labelNames) {

@@ -49,9 +42,15 @@ if (label === 'le') {

this.bucketExemplars = this.upperBounds.reduce((acc, upperBound) => {
acc[upperBound] = null;
return acc;
}, {});
if (config.enableExemplars) {
this.enableExemplars = true;
this.bucketExemplars = this.upperBounds.reduce((acc, upperBound) => {
acc[upperBound] = null;
return acc;
}, {});
Object.freeze(this.bucketExemplars);
this.observe = this.observeWithExemplar;
} else {
this.observe = this.observeWithoutExemplar;
}
Object.freeze(this.bucketValues);
Object.freeze(this.bucketExemplars);
Object.freeze(this.upperBounds);

@@ -90,2 +89,3 @@

updateExemplar(labels, value, exemplarLabels) {
if (Object.keys(exemplarLabels).length === 0) return;
const hash = hashObject(labels, this.sortedLabelNames);

@@ -269,9 +269,12 @@ const bound = findBound(this.upperBounds, value);

function createBaseValues(labels, bucketValues, bucketExemplars) {
return {
const result = {
labels,
bucketValues: { ...bucketValues },
bucketExemplars: { ...bucketExemplars },
sum: 0,
count: 0,
};
if (bucketExemplars) {
result.bucketExemplars = { ...bucketExemplars };
}
return result;
}

@@ -301,3 +304,5 @@

name,
bucketData.bucketExemplars[upperBound],
bucketData.bucketExemplars
? bucketData.bucketExemplars[upperBound]
: null,
bucketData.labels,

@@ -320,3 +325,3 @@ );

`${histogram.name}_bucket`,
d.data.bucketExemplars['-1'],
d.data.bucketExemplars ? d.data.bucketExemplars['-1'] : null,
d.data.labels,

@@ -323,0 +328,0 @@ ),

{
"name": "prom-client",
"version": "15.1.0",
"version": "15.1.1",
"description": "Client for prometheus",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -54,3 +54,3 @@ # Prometheus client for node.js [![Actions Status](https://github.com/siimon/prom-client/workflows/Node.js%20CI/badge.svg?branch=master)](https://github.com/siimon/prom-client/actions)

- `prefix` an optional prefix for metric names. Default: no prefix.
- `register` to which metrics should be registered. Default: the global default registry.
- `register` to which registry the metrics should be registered. Default: the global default registry.
- `gcDurationBuckets` with custom buckets for GC duration histogram. Default buckets of GC duration histogram are `[0.001, 0.01, 0.1, 1, 2, 5]` (in seconds).

@@ -57,0 +57,0 @@ - `eventLoopMonitoringPrecision` with sampling rate in milliseconds. Must be greater than zero. Default: 10.

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc