-
Notifications
You must be signed in to change notification settings - Fork 34
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
Proxy sli #342
Proxy sli #342
Conversation
Skipping CI for Draft Pull Request. |
/retest |
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.
overall looks good 👍 I added a few suggestions, but nothing critical.
Could you please update also the unit tests?
Codecov ReportAttention:
📢 Thoughts on this report? Let us know!. |
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.
Looks good overall! Just a few questions in the comments.
/retest |
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.
Just a few reminders
pkg/metrics/metrics.go
Outdated
// RegServProxyRouteHistogramVec measures the time taken by proxy before forwarding the request | ||
RegServProxyRouteHistogramVec *prometheus.HistogramVec | ||
// RegServProxyResponseHistogramVec measures the response time for either response or error from proxy when there is no routing | ||
RegServProxyResponseHistogramVec *prometheus.HistogramVec |
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.
You could make the variable names shorter by dropping the RegServ
prefix:
// RegServProxyRouteHistogramVec measures the time taken by proxy before forwarding the request | |
RegServProxyRouteHistogramVec *prometheus.HistogramVec | |
// RegServProxyResponseHistogramVec measures the response time for either response or error from proxy when there is no routing | |
RegServProxyResponseHistogramVec *prometheus.HistogramVec | |
// ProxyRouteHistogramVec measures the time taken by proxy before forwarding the request | |
ProxyRouteHistogramVec *prometheus.HistogramVec | |
// ProxyResponseHistogramVec measures the response time from proxy when there is no routing | |
ProxyResponseHistogramVec *prometheus.HistogramVec |
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
great work @ranakan19 ! 🙌
and thanks for addressing my comments 😄
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 👍 Good job @ranakan19 🥇 🚀
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.
Great work! 🙌
m.WithLabelValues("500", "list").Observe((1 * time.Millisecond).Seconds()) | ||
|
||
//then | ||
assert.Equal(t, 4, promtestutil.CollectAndCount(m, "sandbox_test_histogram_vec")) |
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.
Just a question, why is it 4? Maybe worth adding a comment
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.
because HistogramVec are partioned on labels, and we have 4 label combination in the test. Sure let me add a label
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: MatousJobanek, rajivnathan, ranakan19, xcoulon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
This PR introduces two metrics for Registration-Service proxy:
RegServProxyApiHistogramVec
- measures the time taken by proxy before forwarding the requestRegServWorkspaceHistogramVec
- measures the response time for either response or error from proxy when there is no routingSince they are both of the type HistogramVec, the metrics can be partioned on labels.
RegServWorkspaceHistogramVec
uses labelsstatus_code
andkube_verb
to identify the type of request() and whether the request was successful.While
RegServProxyRouteHistogramVec
uses labelsstatus_code
androute_to
to store Host URL of the target cluster and whether the request was acceptable. In the case that the request wasn't acceptable the value for route_to will be populated asRejected
Here is a sample of the output of metrics on dev-cluster: