-
Notifications
You must be signed in to change notification settings - Fork 281
feat: api transport metrics #4774
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
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: Alex Pana <[email protected]>
Signed-off-by: Alex Pana <[email protected]>
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
the current set up breaks the tests so it still needs some work! |
Signed-off-by: Alex Pana <[email protected]>
"golang.org/x/oauth2" | ||
"google.golang.org/api/option" | ||
htransport "google.golang.org/api/transport/http" |
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.
httptransport?
return c, err | ||
} | ||
|
||
// Create an authenticated transport using htransport |
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 comment does not seem to align with the code in the immediate block.
@@ -45,7 +46,8 @@ func RegisterPrometheusExporter(addr string) error { | |||
// Run the Prometheus exporter as a scrape endpoint. | |||
go func() { | |||
mux := http.NewServeMux() | |||
mux.Handle("/metrics", pe) | |||
mux.Handle("/metrics", pe) // OpenCensus | |||
mux.Handle("/experimental-metrics", promhttp.Handler()) // Prometheus Go client |
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.
I grant its experimental right now but not sure that the path we want to use. How about /prom-metrics or /prometheus-metrics ?
|
||
statusCode := "0" // good to have a default value here | ||
if resp != nil { | ||
statusCode = strconv.Itoa(resp.StatusCode) |
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 is not bounded.
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.
I think we should be going through bounded types and then converting to string at the WithLabelValues call to ensure the labels are actually bounded.
Patch adds transport level API metrics for HTTP calls that KCC makes.
Follow up work:
controller_name
for TF and DCL resourcesTesting