Skip to content
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

Merged
merged 2 commits into from
Jan 15, 2019

Conversation

jpeeler
Copy link

@jpeeler jpeeler commented Dec 19, 2018

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.

@openshift-ci-robot openshift-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2018
pkg/metrics/metrics.go Outdated Show resolved Hide resolved
@openshift-ci-robot openshift-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Dec 19, 2018
@ecordell
Copy link
Member

/retest

1 similar comment
@jpeeler
Copy link
Author

jpeeler commented Dec 22, 2018

/retest

@ecordell
Copy link
Member

/skip gitlab-ci/pipeline

go http.ListenAndServe(":8080", nil)

http.Handle("/metrics", promhttp.Handler())
go http.ListenAndServe(":8081", nil)
Copy link
Member

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

Copy link
Author

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".

Copy link
Member

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)
Copy link
Member

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?

Copy link
Author

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)
Copy link
Member

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

Copy link
Author

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.

@ecordell
Copy link
Member

ecordell commented Jan 8, 2019

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 8, 2019
@ecordell
Copy link
Member

ecordell commented Jan 8, 2019

/skip gitlab-ci/pipeline

@openshift-ci-robot openshift-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 10, 2019
@ecordell
Copy link
Member

@jpeeler I'm optimistic about this merging if you rebase?

Jeff Peeler added 2 commits January 14, 2019 11:13
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.
@openshift-ci-robot openshift-ci-robot removed lgtm Indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Jan 14, 2019
@ecordell
Copy link
Member

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Jan 14, 2019
@openshift-ci-robot
Copy link
Collaborator

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jpeeler
Copy link
Author

jpeeler commented Jan 14, 2019

/skip gitlab-ci/pipeline
not sure if this will work...

@jpeeler
Copy link
Author

jpeeler commented Jan 14, 2019

/refresh

@jpeeler
Copy link
Author

jpeeler commented Jan 14, 2019

/skip

@openshift-merge-robot openshift-merge-robot merged commit 63aa1e1 into operator-framework:master Jan 15, 2019
ecordell pushed a commit to ecordell/operator-lifecycle-manager that referenced this pull request Mar 8, 2019
fix(metrics): remove resources that aren't updated
@njhale njhale added the kind/bug Categorizes issue or PR as related to a bug. label Mar 19, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/bug Categorizes issue or PR as related to a bug. lgtm Indicates that a PR is ready to be merged. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants