Loading
Tezos node exposes an endpoint for prometheus to query metrics
Context
Extracting metrics is absolutely key to understand what's going on in the node both for developing and running it.
Exposing some to prometheus is actually extremely light both in term of pollution in the code (only a couple of extremely straight forward lines of code is required to add a metric, much less than even logging something) and CPU burn at runtime (cost = 0 if the option to export metrics is not set and it is a matter of get/set some references else)
Therefore I would like to make an argument for declaring metrics directly in tezos-p2p tezos-shell (MR !4052 (merged) gives the first example) and make tezos-node exposing them.
Depends on opam-repository!221 (merged)
Manually testing the MR
- Launch
tezos-node run [...] --listen-prometheus 9093and go to http://localhost:9093/metrics to see the result (or set your prometheus server to query it!). - Don't add the
--listen-prometheusand nothing changed.
Checklist
- N/A Document the interface of any function added or modified (see the coding guidelines)
- Document any change to the user interface, including configuration parameters (see node configuration)
- Provide automatic testing (see the testing guide).
- For new features and bug fixes, add an item in the appropriate changelog (
docs/protocols/alpha.rstfor the protocol and the environment, theDevelopment Versionsection ofCHANGES.mdfor everything else). - Select suitable reviewers using the
Reviewersfield below. - Select as
Assigneethe next person who should take action on that MR
Edited by Pierre Boutillier