Add more metrics to the DHT crawler#436
Draft
abitofevrything wants to merge 4 commits into
Draft
Conversation
mgdigital
reviewed
Jul 1, 2025
| scrapePeerCount prometheus.Histogram | ||
| scrapeNodeCount prometheus.Histogram | ||
| scrapeNodeTotal *prometheus.CounterVec | ||
| logger *zap.SugaredLogger |
Collaborator
There was a problem hiding this comment.
That's a LOT of properties to add here; I think much of this is already being collected here/elsewhere? https://github.com/bitmagnet-io/bitmagnet/blob/main/internal/protocol/dht/server/prometheus_collector.go
Contributor
Author
There was a problem hiding this comment.
All the metrics I've added here are separate from the existing collectors. They serve two purposes not covered by the sucess/latency metrics already existing.
- The histograms gather statistics about the responses received from the DHT per query type (something that isn't recorded by current metrics as the recorded metric depends on the query type). This isn't immediately useful to us, it's more interesting from a general DHT analysis perspective.
- The counters gather statistics about the flow of data through the DHT crawler itself.
Contributor
Author
There was a problem hiding this comment.
I am aware it's a lot of metrics to add; my opinion with metrics is that it's better to err on the side of too many rather than not enough seeing as they are so cheap to add. If there's any metrics in particular you think aren't useful, we can get rid of them.
fd8eaa9 to
ac2831f
Compare
54 tasks
giorgiobrullo
added a commit
to giorgiobrullo/bitmagnet
that referenced
this pull request
Mar 1, 2026
Add per-operation metrics for discovered nodes, find_node, get_peers, sample_infohashes, scrape, infohash triage, and metainfo requests. Also adds FilterKnownAddrs to ktable.Table interface for IPv6 dual-stack node filtering. Based on PR bitmagnet-io#436 by abitofevrything, adapted for our dual-stack codebase. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mdalsi
added a commit
to mdalsi/bitmagnet
that referenced
this pull request
Apr 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Depends on #435 as the new filtering logic in
discovered_nodesaffects metric collection.