-
Notifications
You must be signed in to change notification settings - Fork 544
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(metrics): remove resources that aren't updated #637
fix(metrics): remove resources that aren't updated #637
Conversation
/retest |
1 similar comment
/retest |
/skip gitlab-ci/pipeline |
go http.ListenAndServe(":8080", nil) | ||
|
||
http.Handle("/metrics", promhttp.Handler()) | ||
go http.ListenAndServe(":8081", 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.
Also serving a nil handler here
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.
Yes, nil is intentional, it should use the "DefaultServeMux".
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.
Gotcha - didn't know about DefaultServeMux - I think go didn't have a muxer last time I used http
? 😂
@@ -87,6 +93,10 @@ func main() { | |||
log.Panicf("error configuring operator: %s", err.Error()) | |||
} | |||
|
|||
http.Handle("/metrics", promhttp.Handler()) | |||
go http.ListenAndServe(":8081", 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 is serving a nil handler - did you mean to serve metrics on this port?
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 port change was intentional, though perhaps it's not the best? OLM serves healthz from port 8080, so I wanted the metrics ports to be consistent.
// TODO: both of the following require vendor updates (add k8s.io/apiserver and update prometheus) | ||
//healthz.InstallHandler(mux) //(less code) | ||
//mux.Handle("/metrics", promhttp.Handler()) //other form is deprecated | ||
http.Handle("/metrics", prometheus.Handler()) | ||
go http.ListenAndServe(":8080", 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.
Similar issue here, though this has clearly been here a while
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.
See other comments, I'm nearly certain I've confirmed that healthz was being served correctly.
/lgtm |
/skip gitlab-ci/pipeline |
@jpeeler I'm optimistic about this merging if you rebase? |
Make the resources that are updated by the catalog operator be served from there too (and remove them from olm). Update the prometheus http handler to use the non-deprecated version, and do it on port 8081. Also, actually serve the health check in OLM.
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: ecordell, jpeeler 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 |
/skip gitlab-ci/pipeline |
/refresh |
/skip |
fix(metrics): remove resources that aren't updated
These resources are updated in the catalog operator, so a new endpoint
needs to be created to scrape them from there instead. This commit
merely removes them from being served from the olm operator.
(So this is really just a partial fix.)Updated to actually serve the new metrics properly.