-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
metrics: move metrics
up, outside servers
#6606
Conversation
This change moves the metrics configuration from per-server level to a single config knob within the `http` app. Enabling `metrics` in any of the configured servers inside `http` enables metrics for all servers. Fix #6604 Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
any idea when this will be merged? I ran into this issue after i was advised to use the beta version of Caddy |
This looks wrong to me. I argue that it's reasonable to want to enable a metrics route for a specific server (e.g. |
This isn't about serving metrics, it's about enabling metrics. It doesn't really work to only enable metrics for one server because the |
Okay; if it's technically complicated, maybe a better approach is to keep the metrics internal to
wherever you want to expose it? I think what confuses me is the line
|
I think you're confused. There's a |
You're confusing 2 things: enabling HTTP handling metrics collection and exposure/serving on the admin endpoint, and exposing metrics on an endpoint other than the admin endpoint. Enabling metrics here (in this PR), means enabling the HTTP traffic metrics collection. They're exposed only on admin endpoint (default: Previously (before this PR), enabling HTTP metrics collection was done by adding the key This is misleading because metrics were always enabled for all servers, plus a bunch of other issues. The fix requires lifting the
Use the
That's not the correct interpretation, not that it was ever possible anyways. Nil-ing the field doesn't change the behavior. The line you're looking at is about adapting the old configuration to the new one. Once we copied the configuration, the older data is no longer meaningful because it's not used. We only need it there for existing users who haven't changed their config. We don't want to suddenly break them, so I added a translation.
It never was. There's a label for the server name to track which "server" it's part of. As a caddyfile user, you'll rarely have to deal with the notion of server, unless you serve sites on multiple ports other than 80/443.
Nothing is lost anyways. The field |
Thanks @mohammed90 for the explanation! I'm new to the project but I hope I'll find ways to contribute as I get more involved. Thanks again! |
This change moves the metrics configuration from per-server level to a single config knob within the
http
app. Enablingmetrics
in any of the configured servers insidehttp
enables metrics for all servers.Fix #6604