prom-client
Advanced tools
Comparing version 15.1.0 to 15.1.1
@@ -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(); |
@@ -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. |
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
125600
3139