Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix labelset validation in Summary #263

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/summary.js
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ function observe(labels) {
return value => {
const labelValuePair = convertLabelsAndValues(labels, value);

validateLabel(this.labelNames, this.labels);
validateLabel(this.labelNames, labels);
if (!Number.isFinite(labelValuePair.value)) {
throw new TypeError(
`Value is not a valid number: ${util.format(labelValuePair.value)}`
Expand Down
2 changes: 1 addition & 1 deletion test/__snapshots__/summaryTest.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ exports[`summary global registry with a parameter for each variable labels shoul

exports[`summary global registry with a parameter for each variable remove should throw error if label lengths does not match 1`] = `"Invalid number of arguments"`;

exports[`summary global registry with a parameter for each variable should throw an error when the value is not a number 1`] = `"Value is not a valid number: 3ms"`;
exports[`summary global registry with a parameter for each variable should throw an error when the value is not a number 1`] = `"Added label \\"0\\" is not included in initial labelset: []"`;

exports[`summary global registry with param as object labels should throw error if label lengths does not match 1`] = `"Invalid number of arguments"`;

Expand Down