*: add p2p send duration metric#4506
Conversation
There was a problem hiding this comment.
Pull request overview
Adds a Prometheus histogram to measure wall-clock duration of p2p sends (both Send and SendReceive) and introduces an optional “topic” label to segment timings by sub-protocol/message type.
Changes:
- Add
p2p_send_duration_secondshistogram withpeer,protocol, andtopiclabels. - Add
WithSendMetricTopicoption and plumb metric-topic support through p2p send options. - Populate topic labels from key call sites (QBFT, ParSigEx, PeerInfo, Priority).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| p2p/sender.go | Adds metric-topic option and records send duration for Send/SendReceive. |
| p2p/metrics.go | Defines new p2p_send_duration_seconds histogram (peer/protocol/topic). |
| core/priority/prioritiser.go | Tags priority exchange sends with priority_consensus topic. |
| core/parsigex/parsigex.go | Tags ParSigEx broadcasts with duty-type-derived topic. |
| core/consensus/qbft/qbft.go | Tags QBFT broadcasts with message-type-derived topic. |
| app/peerinfo/peerinfo.go | Tags periodic peerinfo requests with peerinfo topic. |
| app/peerinfo/adhoc.go | Tags ad-hoc peerinfo request with peerinfo_adhoc topic. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: kalo <24719519+KaloyanTanev@users.noreply.github.com>
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #4506 +/- ##
=======================================
Coverage 57.11% 57.11%
=======================================
Files 245 245
Lines 32920 32939 +19
=======================================
+ Hits 18801 18813 +12
- Misses 11752 11758 +6
- Partials 2367 2368 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|



Add p2p send duration histogram with topic labels. This can help us debug potential contentions.
category: feature
ticket: none