Unverified Commit 033cfc9e authored by Cole White's avatar Cole White Committed by GitHub
Browse files

Bugfix: clone labels when interpolating metric name (#235)

When the log metrics output is first in line,
`metrics.utils.formatLabels` will mutate the labels array.
This mutation will leak to the other metrics clients and manifest
as an Invalid number of arguments in prom-client.

Bump to 2.8.2

Bug: T278141
parent cd923802
......@@ -28,15 +28,16 @@ function zipLabels(options, labels) {
// Formats label set with metric name
function formatLabels(options, labels) {
let formattedLabels = [...labels];
if (options.labels.names) {
labels = zipLabels(options, labels);
formattedLabels = zipLabels(options, formattedLabels);
}
if (options.labels.labelPosition === 'before') {
labels.push(options.name);
formattedLabels.push(options.name);
} else {
labels.unshift(options.name);
formattedLabels.unshift(options.name);
}
return labels;
return formattedLabels;
}
module.exports.normalizeName = normalizeName;
......
{
"name": "service-runner",
"version": "2.8.1",
"version": "2.8.2",
"description": "Generic nodejs service supervisor / cluster runner",
"main": "service-runner.js",
"bin": {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment