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

Improve guard to avoid invalid number of arguments error message #53

Open
leftieFriele opened this issue Apr 17, 2024 · 0 comments · May be fixed by #57
Open

Improve guard to avoid invalid number of arguments error message #53

leftieFriele opened this issue Apr 17, 2024 · 0 comments · May be fixed by #57
Labels
enhancement New feature or request

Comments

@leftieFriele
Copy link
Contributor

leftieFriele commented Apr 17, 2024

Description of the problem

There's a type of error which happens frequently in applications using prom-client where the arguments don't match up.
It could be that a label on a metrics is derived from a variable and in certain cases this variable is undefined, leading to the error message seen here:

  Error: Invalid number of arguments
    at exports.getLabels (/app/node_modules/prom-client/lib/util.js:56:9)
    at Histogram.labels (/app/node_modules/prom-client/lib/histogram.js:164:18)

Proposed solutions

  • send a pull request to the prom-client project with an error message which includes label names & args so it's easier to debug this line
  • improve the guard to check for labels being undefined or null
@leftieFriele leftieFriele added the enhancement New feature or request label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant