Skip to content
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

admin: lower log level to Debug for /metrics requests #3749

Merged

Conversation

hairyhenderson
Copy link
Collaborator

When monitoring Caddy with Prometheus pointed at the default endpoint (http://localhost:2019/metrics), things can get a little verbose:

2020/09/24 00:17:00.484 INFO    admin.api       received request        {"method": "GET", "host": "localhost:2019", "uri": "/metrics", "remote_addr": "127.0.0.1:52404", "headers": {"Accept":["application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1"],"Accept-Encoding":["gzip"],"User-Agent":["Prometheus/2.21.0"],"X-Prometheus-Scrape-Timeout-Seconds":["10.000000"]}}
2020/09/24 00:17:15.485 INFO    admin.api       received request        {"method": "GET", "host": "localhost:2019", "uri": "/metrics", "remote_addr": "127.0.0.1:52404", "headers": {"Accept":["application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1"],"Accept-Encoding":["gzip"],"User-Agent":["Prometheus/2.21.0"],"X-Prometheus-Scrape-Timeout-Seconds":["10.000000"]}}
2020/09/24 00:17:30.483 INFO    admin.api       received request        {"method": "GET", "host": "localhost:2019", "uri": "/metrics", "remote_addr": "127.0.0.1:52404", "headers": {"Accept":["application/openmetrics-text; version=0.0.1,text/plain;version=0.0.4;q=0.5,*/*;q=0.1"],"Accept-Encoding":["gzip"],"User-Agent":["Prometheus/2.21.0"],"X-Prometheus-Scrape-Timeout-Seconds":["10.000000"]}}
[... ad nauseum ...]

I'm not ecstatic about this solution, but I feel like it's good enough until we can figure out a better approach. Ideally an admin module would be able to control its own logging in some way. This'll at least make monitoring Caddy with Prometheus a less noisy activity for the 2.2 release...

Signed-off-by: Dave Henderson dhenderson@gmail.com

Signed-off-by: Dave Henderson <dhenderson@gmail.com>
@mholt mholt added this to the v2.3.0 milestone Sep 24, 2020
@mholt mholt added the under review 🧐 Review is pending before merging label Sep 24, 2020
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for helping to improve things, Dave!

admin.go Show resolved Hide resolved
admin.go Outdated Show resolved Hide resolved
admin.go Outdated Show resolved Hide resolved
Co-authored-by: Matt Holt <mholt@users.noreply.github.com>
Copy link
Member

@mholt mholt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@mholt mholt removed the under review 🧐 Review is pending before merging label Sep 25, 2020
@mholt mholt merged commit 8515267 into caddyserver:master Sep 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants