-
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ import ( | |
"strings" | ||
"time" | ||
|
||
"github.com/prometheus/client_golang/prometheus" | ||
"github.com/prometheus/client_golang/prometheus/promhttp" | ||
log "github.com/sirupsen/logrus" | ||
v1 "k8s.io/api/core/v1" | ||
|
||
|
@@ -45,7 +45,7 @@ var ( | |
) | ||
|
||
func init() { | ||
metrics.Register() | ||
metrics.RegisterOLM() | ||
} | ||
|
||
// main function - entrypoint to OLM operator | ||
|
@@ -100,12 +100,11 @@ func main() { | |
http.HandleFunc("/healthz", func(w http.ResponseWriter, r *http.Request) { | ||
w.WriteHeader(http.StatusOK) | ||
}) | ||
// 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 commentThe 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 commentThe 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. |
||
|
||
http.Handle("/metrics", promhttp.Handler()) | ||
go http.ListenAndServe(":8081", nil) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 commentThe 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 commentThe 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 |
||
|
||
_, done := operator.Run(stopCh) | ||
<-done | ||
} |
Large diffs are not rendered by default.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.