celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

feat(p2p/dht): Enable dht server metrics

Open walldiss opened this issue 11 months ago • 3 comments

Implementation ideas

Enable dht server metrics to track server load.

walldiss avatar Jan 24 '25 16:01 walldiss

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

  1. 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
  2. Should this only apply to bridge/full nodes (dht servers), or also light nodes (dht clients)?

  3. Separate --dht.metrics flag or include in existing --p2p.metrics?

Thanks!

TheRealSibasishBehera avatar Jun 17 '25 17:06 TheRealSibasishBehera

Hi @walldiss, just following up on my previous comment—looking forward to your thoughts. Thanks!

TheRealSibasishBehera avatar Jun 23 '25 16:06 TheRealSibasishBehera

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!

walldiss avatar Jun 23 '25 17:06 walldiss