-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Add collector for database/sql#DBStats #848
Conversation
Thanks. This is a neat idea. I'm just not sure if it should live in the Go instrumentation client or if it should rather be a separate tool. Another question is if the metrics should be prefixed with I would like to discuss that with the Prometheus community first. This kind of discussions happens on the prometheus-developers mailing list. @johejo would you like to start a thread there? Otherwise, I can do it. |
Thank you. |
To put the conclusion from the mailing list thread here: In general, it's fine to have this kind of collector here in prometheus/client_golang. Nobody voiced their opinion if we should have a separate However, this PR is already the third implementation after https://github.com/dlmiddlecote/sqlstats and https://github.com/krpn/go-sql-db-stats . At first glance, the latter seems more elaborate, but it's still not following all best practices (e.g. counters don't end on Next step would be to take the best of all three implementations and unite them here (could be in this PR or a new one) and also make sure naming conventions are honored (e.g. counter names end on |
c8aed63
to
d330282
Compare
MaxIdleTimeClosed is not available below go1.15. Therefore it is TODO. Signed-off-by: Mitsuo Heijo <[email protected]>
d330282
to
bdbfa43
Compare
Fixed label naming. |
Hi @johejo , are you still working on this? If you feel it's ready for a detailed review, please let me know. (At first glance, I saw that you haven't moved the code into a new |
It's okay. |
I thought it would be better to have a separate PR for the dbstats collector and the new package. |
MaxIdleTimeClosed is not available below go1.15.
Therefore it is TODO.
Signed-off-by: Mitsuo Heijo [email protected]