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
prometheus metrics support #352
Comments
There already seems to be a project in https://github.com/svartalf/unbound-telemetry that does this. |
In the commit there is the file https://github.com/NLnetLabs/unbound/blob/master/contrib/metrics.awk . You could use this file with eg. |
* nlnet/master: (117 commits) - Fix NLnetLabs#358: Squelch udp connect 'no route to host' errors on low verbosity. Changelog entry for rc tags 1.13.0rc3 and rc4. - Fix assertion failure on double callback when iterator loses interest in query at head of line that then has the tcp stream not kept for reuse. - Fix contrib/metrics.awk for FreeBSD awk compatibility. - Fix compile warnings in rpz initialization. - Fix compile warnings for windows. - Fix when use free buffer to initialize rbtree for stream reuse. - Fix compile warning for type cast in http2_submit_dns_response. - Clear readagain upon decommission of pending tcp structure. - Fix that after failed read, the readagain cannot activate. - For NLnetLabs#352: contrib/metrics.awk for Prometheus style metrics output. - Fix to omit UDP receive errors from log, if verbosity low. These happen because of udp-connect. - tag for the 1.13.0rc2 release. - Fix readagain and writeagain callback functions for comm point cleanup. - Attempt fix for libevent state in tcp reuse cases after a packet is written. - Fix memory leak for edns client tag opcode config element. - Remove debug commands from reuse tests. - Better fix for reuse tree comparison for is-tls sockets. Where the tree key identity is preserved after cleanup of the TLS state. - Fix udp-connect on FreeBSD, do send calls on connected UDP socket. - with udp-connect ignore connection refused with UDP timeouts. ...
Thanks for your feedback. The issue with the awk approach is that the data is generated asynchronously, meaning that the data does not represent unbound's state when prometheus came along end fetched it. |
What is the awk issue? Asynchronous? Do you want cumulative numbers or something? The awk script runs very quick, so it does not delay the measurement in that sense. |
Maybe I misunderstood, but I assumed the awk command runs at a fixed interval (cronjob) and writes the output into a file served by a webserver (instead of running when prometheus asks for it). We will test with the noreset version of stats Thanks! |
At Let's Encrypt we deploy Unbound and unbound_exporter. We also semi-recently took over maintenance of the prometheus unbound_exporter tool: https://github.com/letsencrypt/unbound_exporter. Some reasons we would prefer to see Prometheus metrics exported directly by Unbound:
Also, to clarify: Prometheus stats are generally fetched over the network, via an HTTP GET. So the awk script only solves a part of the problem. What we would really like is an option for Unbound to serve stats in Prometheus format via HTTP. |
And while you're at it, would be nice to have prometheus metrics directly out of |
prob the easiest way to use it, to integrate with prometheus, would be to run it from But, TBH, we just use the LetsEncrypt exporter - it does a fine job. |
Hi,
it would be great to see prometheus metrics support directly in unbound,
this would make 3rd party exporter tools with varying quality unnecessary and the exporte would always be compatible with unbound since it is directly integrated. NLnetLabs appears to agree that prometheus makes sense since other NLnetLabs projects incorporate it already (like routinator).
thanks!
The text was updated successfully, but these errors were encountered: