Conversation
PR SummaryMedium Risk Overview Reviewed by Cursor Bugbot for commit 5c6d057. Bugbot is set up for automated code reviews on this repo. Configure here. |
There was a problem hiding this comment.
The histogram at dispatch.go line 263 records durations for both successful and failed reads with no distinguishing attribute. Since ReadAt respects context cancellation, cancelled reads can return almost instantly and appear as very-short-duration samples mixed with normal reads, making percentiles misleading. Consider adding an error attribute to allow segmentation.
There was a problem hiding this comment.
LGTM — simple observability addition.
Extended reasoning...
Overview
Single-file change to dispatch.go adding an Int64Histogram metric (orchestrator.nbd.dispatch.read_duration) and instrumenting the ReadAt call in cmdRead with time.Now() / time.Since. No behavioral changes.
Security risks
None. The change only adds a metrics recording call; it does not touch auth, crypto, permissions, or any external input paths.
Level of scrutiny
Low. This is a pure observability change — no logic is altered, the new histogram is package-level and initialized via the existing utils.Must pattern, and the two added lines are isolated inside an already-goroutined closure. The risk surface is essentially zero.
Other factors
The one flagged issue (missing outcome attribute on the histogram) is a nit around metric quality posted as an inline comment. It does not affect correctness or safety. The rest of the change is straightforward and follows established patterns in the codebase.
Add a metric to