-
Notifications
You must be signed in to change notification settings - Fork 25
feat: add blocked peer metrics #708
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: unstable
Are you sure you want to change the base?
Conversation
|
Claude finished @petarjuki7's task —— View job Code Review CompleteSummaryThis PR adds metrics for tracking blocked peers in the network layer. The implementation is straightforward and functionally correct, but there are several considerations around metric design, naming consistency, and observability best practices. Key FindingsPositive Aspects:
Areas for Improvement:
Detailed ReviewSee inline comments for specific technical details on:
TestingThe existing test coverage in
Recommendation: Consider adding a test that verifies the metrics are updated correctly during block/unblock operations. Pre-Merge ChecklistBefore merging, ensure you've run: make cargo-fmt # Format code
make lint # Run clippy
make test # Run test suiteRecommendationsHigh Priority:
Medium Priority: Low Priority: Note: I cannot run the linter, formatter, or tests directly due to tool access limitations. Please run these commands locally before merging. |
| "Count of successful handshakes by number of matching subnets", | ||
| &["match_count"], | ||
| "blocked_peers_connecting", | ||
| "Count of blocked peers trying to reconnect", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
High Cardinality Concern
Using peer_id as a label creates high cardinality, which can cause performance issues in Prometheus:
- Each unique blocked peer creates a new time series
- In a large network, this could result in thousands of time series
- High cardinality can slow down queries and increase memory usage
Considerations:
- Is per-peer granularity necessary? Consider if aggregate metrics (total blocked connection attempts) would suffice
- If per-peer tracking is essential, consider:
- Implementing a limit on tracked peers
- Using a shorter peer ID representation (first 8 chars)
- Adding documentation about the cardinality implications
- Consider whether this data might be better suited for structured logs rather than metrics
The aggregate PEERS_BLOCKED gauge already tracks the count of blocked peers, which may be sufficient for most monitoring needs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if its an issue.
59bcf17 to
7323f5e
Compare
Issue Addressed
Addresses Issue #653
Proposed Changes
Adds a few more metrics about blocked peers.
Tracks the number of blocked peers, and how many times a particular blocked peer tried to dial us.
Additional Info
Can add more metrics if we think anything else is particularly useful