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
fix: Observe accurate backend_read_seconds
duration
#27848
Conversation
FYI @rosstimothy @espadolini, if you do monitor this I would expect a jump once this PR lands. Sorry for making our metrics worse. ;) |
@@ -124,7 +124,7 @@ func (s *Reporter) GetRange(ctx context.Context, startKey []byte, endKey []byte, | |||
|
|||
start := s.Clock().Now() | |||
res, err := s.Backend.GetRange(ctx, startKey, endKey, limit) | |||
batchReadLatencies.WithLabelValues(s.Component).Observe(time.Since(start).Seconds()) | |||
batchReadLatencies.WithLabelValues(s.Component).Observe(s.Clock().Since(start).Seconds()) |
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.
Using a time.Now/time.Since pair is also fine, but I expect the clock will raise less eyebrows.
backend_read_seconds
duration
cc @dilchenko too |
Thanks everyone for the quick reviews. |
@codingllama See the table below for backport results.
|
The
backend_read_seconds
metric is not accounting for the read itself, this fixes that. Additionally, we now use the same clock to determine start and end times.