-
Notifications
You must be signed in to change notification settings - Fork 72
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
frontend: refactor metrics #1413
Conversation
39d876d
to
7966ad8
Compare
Please rebase pull request. |
7966ad8
to
f991ced
Compare
Tested in my dev environment in conjunction with #1420 |
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.
Raised a couple stupid nits but overall love what you've done here, especially with the test code.
} | ||
|
||
func (c *ContextError) Error() string { | ||
return fmt.Sprintf( | ||
"error retrieving value from context, value obtained was '%v' and type obtained was '%T'", | ||
"error retrieving value for key %q from context, value obtained was '%v' and type obtained was '%T'", | ||
c.key, |
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.
Nice.
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.
Appreciate the refactoring of the context API. I won't ask for it this time but in the future it would be good to split refactoring into one or more focused commits for easier review. There's a lot packed into this one commit.
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.
Right, I got a bit too enthusiastic here.
This commit refactors the frontend service to report more sensible and useful metrics. The visible changes are: * The `endpoint` label of the `frontend_health` gauge metric is dropped. * The `frontend_requests_total` gauge metric is renamed to `frontend_http_requests_total` (counter). * The `frontend_duration` gauge metric is renamed to `frontend_http_requests_duration_seconds` (histogram). The histogram buckets have been chosen to match the MSFT requirements in terms of latency: [0.25s, 0.5s, 1s, 2.5s, 5s, 10s]. Signed-off-by: Simon Pasquier <spasquie@redhat.com>
f991ced
to
4e0f4c2
Compare
What this PR does
This commit refactors the frontend service to report more sensible and useful metrics.
The visible changes are:
endpoint
label of thefrontend_health
gauge metric is dropped.frontend_requests_total
gauge metric is renamed tofrontend_http_requests_total
(counter).frontend_duration
gauge metric is renamed tofrontend_http_requests_duration_seconds
(histogram).The histogram buckets have been chosen to match the MSFT requirements in terms of latency: [0.25s, 0.5s, 1s, 2.5s, 5s, 10s].
Jira:
Link to demo recording:
Special notes for your reviewer