-
Notifications
You must be signed in to change notification settings - Fork 378
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
Update README to reflect more v12 changes #337
Conversation
I wasn't thinking that registerCollector() would be used outside of the defaults, its a somewhat unfortunate interface (a version that supports callbacks would be better, but since .metrics() doesn't take a callback, that's not an option ATM), but it is what it is, and if prom-client wants to expose it I guess its at least simple and should be easy to keep stable. |
The functions passed in to const gauge = new client.Gauge({
name: 'metric_name',
help: 'metric_help',
collect() {
this.set(/* value or labels+value */);
}
}); We could also support |
Thanks for doing this! Looks great and nice to get some input for someone that speaks english natively! I don't see any reason for not exposing the |
Yes, I guess maybe its useful. I'm not sure if people are adding it to the .ts and the README because they actually are using it (or want to), or just because its there.
Yes, but that's not because I thought it was easier, or didn't have the time to make them async, or anything like that. They are sync because they are called by It looked to me that making .metrics async was a pretty major change that would be guaranteed to break every single user of prom-client (at least, I can't think of a reason to use prom-client and not call |
Hey cool this update would have saved me some time to understand things ^^ BTW, the examples should be updated too. Do you mind to update it also, or I open a PR also? Thank you! |
Hey @Shudrum , thanks for pointing those out. I'm going to open a PR today with the async changes I'm proposing above, so before changing the examples, let's see if that change moves forward. :) |
Perfect! Thank you @zbjornson! |
I especially like that the inaccuracy around GC stats is updated. Let's get this merged! |
Moot with #361 |
Most significantly, adds a section about
registerCollector
.Also some minor cleanup and condensing.