feat(p2p/dht): Enable dht server metrics
Implementation ideas
Enable dht server metrics to track server load.
Hey @walldiss
This issue looks interesting , if no one is on it , can I work on this ?
I had a few question that will help with understanding the issue
-
Do you have any dht server load metrics which are crucial . I was thinking:
- query request rates (FIND_NODE, GET_VALUE, PUT_VALUE)
- query response times and error rates
- routing table size and health
-
Should this only apply to bridge/full nodes (dht servers), or also light nodes (dht clients)?
-
Separate --dht.metrics flag or include in existing --p2p.metrics?
Thanks!
Hi @walldiss, just following up on my previous comment—looking forward to your thoughts. Thanks!
Hey! A few more details are missing from the original issue.
Some metrics are already implemented inside the libp2p/kad-dht package you would need to connect them to our metrics collector: https://github.com/libp2p/go-libp2p-kad-dht/blob/master/internal/metrics/metrics.go
It looks like the metrics are initialized from the DHT during startup, which might happen before our meter initialization. That could explain why we’re not seeing them.
Honestly, this feels more complex than a typical “good first issue.” But feel free to give it a try if you’re up for the challenge!