-
Notifications
You must be signed in to change notification settings - Fork 149
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
Add port option to exporter middleware #199
Conversation
I've been thinking about this again, and while my posture has always been that we shouldn't permit much configurability of these middlewares, encouraging implementers to use these as a template and make their own version instead... I have realized that in that "policy" I've been conflating both middlewares unfairly. However, I no longer think this should apply to the Exporter. Or at least it doesn't need to as much. I'm going to go through other closed PRs to see if this new thinking applied to any of them, and I closed them when I maybe shouldn't have. I'm sorry @tragiclifestories that we took forever to respond to this. This sort of landed in the middle of a wider conversation we've been having for a while, and it got bundled with a whole category of changes that I now realize it doesn't really belong with. My bad! If you rebase this to add the "signoff", I'd be happy to merge this. |
Fuck, I'd completely forgotten about this. Will do in the new year. Merry Xmas! |
If the port option is set, all requests for /metrics on other ports will be forwarded to the app. If it is unset or nil, or the ports match, export things as usual. Allows separate mounting of metrics and main app to enforce different security setups etc. Signed-off-by: James Turley <jamesturley@gocardless.com>
643bae3
to
42860ce
Compare
Had 5 spare minutes and a hangover, so done this now. |
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.
+1 on this. Let's get it in and add it to the docs in a subsequent PR.
For now there is only `port` option, see prometheus/client_ruby#199
If the port option is set, all requests for /metrics on other ports will be forwarded to the app. If it is unset or nil, or the ports match, export things as usual.
Allows separate mounting of metrics and main app to enforce different security setups etc.