-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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: report gateway http metrics only when response is successful #8827
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
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.
LGTM.
@iand I've pushed two commits, mind taking a look if they make sense before I merge this?
// Update metrics | ||
i.rawBlockGetMetric.WithLabelValues(contentPath.Namespace()).Observe(time.Since(begin).Seconds()) | ||
// Was response successful? | ||
if code/100 == 2 && err == nil { |
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.
💭
This also ignores 304 Not Modified responses when calculating metrics – i think that was intentional, because those also lower response times, right?
Would it be useful to add a global metric counting 304s, just to know the % of "skipped" responses? (in separate PR)
This fix ensures we don't do any additional work when Etag match what user already has in their own cache.
@lidel you can merge this whenever. I reran CI to fix a flake. |
* fix: report gateway http metrics only when response is successful * fix(gw): 304 Not Modified as no-op This fix ensures we don't do any additional work when Etag match what user already has in their own cache. Co-authored-by: Marcin Rataj <lidel@lidel.org>
Fixes #8820