zerotier / ZeroTierOne

A Smart Ethernet Switch for Earth
https://zerotier.com
Other
14.57k stars 1.71k forks source link

[Feature Request] Add label for source_node_id in zerotier promethues metrics #2402

Open umarhussain15 opened 2 weeks ago

umarhussain15 commented 2 weeks ago

Hi, Currently, the Prometheus metrics exported by Zerotier don't include the source zerotier node which generated them. The documentation says to manually add this label in the scraping job config. This will become a lot of manual works if we want to monitor a lot of zerotier nodes. Also in case of running the zerotier nodes in Kubernetes as pods we will not be able to put this information on ServiceMonitor or PodMonitor due to dynamic nature of the pods.

I suggest enriching the metrics emitted by Zerotier to also include the source node id in the labels of the metrics which are specific to that node. As the node already has the information about its own id it can be a simple operation. For example, the updated metrics will then look like this:

zt_peer_path_count{source_id="wxy123456z",node_id="abc12345de",status="alive"} 0

Thank you.