-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Make /metrics listen on a different address #344
Conversation
It seems a bit excessive to allocate a different port for this, limiting a network would seem sufficient? This would break peoples current setup. |
not sure if there's any way to do it per URI. I've found https://github.com/bu/gin-access-limit but it needs to be attached to the whole Gin engine.
I could add a switch so if there's no |
Sorry for the late reply, I have not had time to make a decision here, I do not really care for the behaviour of having a flat set and not set. It might be ok to have a separate listen, but it will have to wait a couple of releases, I'll get back to you when we have finished other stuff that are a bit pressing. |
I would maybe also add a option to enable/disable the metrics endpoint. Furthermore as it is a prometheus exporter I would suggest to use a port in the default port range of prometheus exporters. default port allocations Maybe something between 9914 and 9921 |
@ohdearaugustin done! I picked btw, seems like some of the tests on upstream are broken. |
Hi, sorry for the back and forth: I think I have landed on that having a separate port is fine, just list it under the breaking change in the Changelog. On the port: this is not an exporter, so use 8001, 9090 or other common web port. The ports in the linked list is to be reserved for applications specifically designed for translating api to metrics. |
So remove the enable flag, and set default listen to local:9090. |
@kradalby Those metrics exported by gin are prometheus metrics. So I don't understand the argumentation that this is not an exporter. It is an exporter integrated in the application. For example Gitlab does the same with it's "exporters" they are also integrated into the application itself.
Never heard of that limitation beforehand. And furthermore why would you remove the ability to enable/disable the endpoint? |
And exporter is a component translating information that is not Prometheus compatible to Prometheus metrics[1]. For example, by querying an API and exporting Metrics. What we do is instrument the code directly, and not rely on a thirdparty/microservice outside of
The "correct" or optimal way to use prometheus, is for all applications in the world to just have a
Basically GitLab is an example breaking the rule.
Metrics should always be available and it also serves as a health endpoint.
|
No problem ;) Most of my days are spent in Prometheus land, so I got this into my head now :P |
No prob! I'll revert the last two commits, plus set the listen port to |
e6d8995
to
6126d6d
Compare
Looks sensible, could you add an entry to the CHANGELOG under breaking? |
Done @kradalby ! Want me to add something at features/changes as well? |
That should cover it, I'll merge it when tests pass |
Addresses #343