fix: align compliancy to Prometheus naming convention#284
Conversation
|
There seems to be some confusion about how to expose a "good" Prometheus metric in this library. Take this example: Aside from the fact that the If I wanted a total of active handles (by component & worker), I could simply use the following promql query: |
|
@izonder CI is broken, which is why I haven't reviewed this yet. @dswarbrick that was to avoid a breaking change, see discussion in #260. If there are other examples, we'd be happy to fix them 🙂 Merging this PR is also a breaking change, so we can clean up all names at once. |
|
@SimenB please pay your attention there are some troubles with Node.js v6.x.x environment in Travis: https://travis-ci.org/siimon/prom-client/jobs/586419309 Seems the problem is out of the task scope. |
d6f2cf6 to
29b6d86
Compare
|
Are CI issues still blocking this PR? I was kind of hoping all the renaming would settle before we roll out prometheus and have to deal with updating queries, alerts and graphs from these breaking changes. |
|
The latest CI failures are real test failures that need to be addressed before this can be merged. I haven't had a chance to look at this in depth though, considering #284 (comment) and the desire to clean up all metric names at once. |
|
It looks like the failed tests are potentially as simple as just needing to account for the addition of the |
|
I just checked this out, rebased it against master, and it passed. The last commit adds timestamp support, and all timestampe support is unneeded. So, I pushed that commit off my branch, and retested, and it passed.... that shows the last commit lacked unit tests! :-) But, since it should be removed, it doesn't matter. I didn't actually look at the output and run it pass the promtool checker, though, so I've no comment on the substance of the PR yet. |
|
|
||
| const NODEJS_ACTIVE_HANDLES = 'nodejs_active_handles'; | ||
| const NODEJS_ACTIVE_HANDLES_TOTAL = 'nodejs_active_handles_total'; | ||
| const NODEJS_ACTIVE_HANDLES_TOTAL_NUMBER = 'nodejs_active_handles_total_number'; |
There was a problem hiding this comment.
The core problem here is that promtool thinks that anything called *_total should be COUNT, right, not a GAUGE? Would renaming to nodejs_active_handles also address this?
There was a problem hiding this comment.
Every renaming is very easy to check with built-in prometheus "linter". Probably, it even could be a good idea just to add the linting as a job to CI pipeline
There was a problem hiding this comment.
Do you need any help with this? I've love to pay it forward
…iimon-master # Conflicts: # lib/metrics/processHandles.js # lib/metrics/processRequests.js
|
Are we already scrubbing this on https://github.com/prometheus/client_js/blob/main/lib/registry.js#L302 ? |
Fixes #283