-
Notifications
You must be signed in to change notification settings - Fork 24
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
Allow multiple prometheus stages with different URLs #532
Conversation
[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 |
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #532 +/- ##
==========================================
- Coverage 66.98% 66.84% -0.14%
==========================================
Files 95 95
Lines 6779 6802 +23
==========================================
+ Hits 4541 4547 +6
- Misses 1973 1988 +15
- Partials 265 267 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
☔ View full report in Codecov by Sentry. |
pkg/pipeline/utils/prom_server.go
Outdated
h := promhttp.HandlerFor(reg, promhttp.HandlerOpts{}) | ||
server.Handler = h | ||
// TODO: This needs more work. enable different endpoints for different handlers, and register them on distinct ServeMux | ||
if !handlerRegistered { | ||
http.Handle("/metrics", promhttp.Handler()) | ||
handlerRegistered = true | ||
} |
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.
Hey @KalmanMeth ,
I think this should work to address your comment:
h := promhttp.HandlerFor(reg, promhttp.HandlerOpts{}) | |
server.Handler = h | |
// TODO: This needs more work. enable different endpoints for different handlers, and register them on distinct ServeMux | |
if !handlerRegistered { | |
http.Handle("/metrics", promhttp.Handler()) | |
handlerRegistered = true | |
} | |
mux := http.NewServeMux() | |
mux.Handle("/metrics", promhttp.HandlerFor(reg, promhttp.HandlerOpts{})) | |
server.Handler = mux |
78b688e
to
28a06bc
Compare
New image: It will expire after two weeks. To deploy this build, run from the operator repo, assuming the operator is running: USER=netobserv VERSION=95b87c7 make set-flp-image |
/lgtm |
@KalmanMeth could you see what's wrong with the e2e test? it kept failing, hitting timeout after deploying FLP, but I didn't see any more accurate error |
Description
At present, all prometheus metrics go to the same port defined globally (:9102).
This PR allows to have multiple prometheus encode stages, each one reporting its metrics via a different port (and/or address).
Default behavior is to continue to report metrics via the globally defined port.
Existing configurations should continue to work without change.
Dependencies
n/a
Checklist
If you are not familiar with our processes or don't know what to answer in the list below, let us know in a comment: the maintainers will take care of that.
If not, you can ignore the rest of this checklist.