chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634
chore(logs): include account_id and chunk_production_key in chunk-endorsement error#15634
Conversation
…orsement error Helps attribute InvalidChunkEndorsement at INFO level without enabling debug logs for the stateless_validation target. Seen via alert: https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4
There was a problem hiding this comment.
Pull request overview
This PR improves observability for chunk-endorsement processing failures by adding identifying context (validator account_id and chunk_production_key) to the client error log, making it easier to attribute InvalidChunkEndorsement events without enabling verbose stateless_validation debug logs.
Changes:
- Extract
account_idandchunk_production_keyfrom incomingChunkEndorsementMessage. - Include these fields in the
tracing::error!event emitted when processing the endorsement fails.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let endorsement = msg.0; | ||
| let account_id = endorsement.account_id().clone(); | ||
| let key = endorsement.chunk_production_key(); | ||
| if let Err(err) = self.chunk_endorsement_tracker.process_chunk_endorsement(endorsement) { |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #15634 +/- ##
=======================================
Coverage 69.41% 69.41%
=======================================
Files 938 938
Lines 213336 213340 +4
Branches 213336 213340 +4
=======================================
+ Hits 148079 148096 +17
+ Misses 59366 59357 -9
+ Partials 5891 5887 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Avoids an AccountId clone (heap alloc + memcpy) on every received endorsement, and lets the error log read account_id/key directly off the still-owned value at the call site.
| target: "client", | ||
| ?err, | ||
| account_id = %endorsement.account_id(), | ||
| key = ?endorsement.chunk_production_key(), |
There was a problem hiding this comment.
In early validator kickout we're moving away from the ChunkProductionKey. Not sure if it makes sense to include it, it might get removed a moment later. /cc @stedfn
There was a problem hiding this comment.
it is fine, it will take a while longer than a moment
Helps attribute InvalidChunkEndorsement at INFO level without enabling debug logs for the stateless_validation target.
Seen via alert:
https://grafana.nearone.org/a/grafana-irm-app/alert-groups/IKHSU3P2Q5YG4