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

Make Probes access logs configurable #1121

Open
Lerentis opened this issue Aug 4, 2024 · 0 comments
Open

Make Probes access logs configurable #1121

Lerentis opened this issue Aug 4, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Lerentis
Copy link

Lerentis commented Aug 4, 2024

Problem

With the current implementation of probes, the default logger, loggs every access request. While this can be beneficial in some cases, it is only noise in the long run. I would like to be able to disable access logs.
Example log entry that i am refering to:

{"message": "10.244.0.1 [04/Aug/2024:20:41:11 +0000] \"GET /healthz HTTP/1.1\" 200 221 \"-\" \"kube-probe/1.30\"", "taskName": "Task-583", "remote_address": "10.244.0.1", "request_start_time": "[04/Aug/2024:20:41:11 +0000]", "first_request_line": "GET /healthz HTTP/1.1", "response_status": 200, "response_size": 221, "request_header": {"Referer": "-", "User-Agent": "kube-probe/1.30"}, "timestamp": "2024-08-04T20:41:11.465308+00:00", "severity": "info"}

Proposal

Make access logs configurable as mentioned in the note here: https://docs.aiohttp.org/en/stable/logging.html#access-logs :

Use web.run_app(app, access_log=None) to disable access logs.

in https://github.com/nolar/kopf/blob/main/kopf/_core/engines/probing.py#L82C26-L82C35

Code

import kopf
import logging

@kopf.on.startup()
def configure(settings: kopf.OperatorSettings, **_):
    settings.probes.access_logs = None

Additional information

Instead of None it could also just a enable boolean, like settings.probes.access_logs.enabled = False.
Another alternative solution would be to drop the access logs to the DEBUG level, but this would make implementation more complex i think.
Please let me know which direction would be acceptable for a PR

@Lerentis Lerentis added the enhancement New feature or request label Aug 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant