-
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
How to suppress health check logs? #2530
Comments
I tend to agree but I'm surprised that health check access logs outpace access logs from policy queries. How frequently do you have the health check invoked? Perhaps another question is what are you relying on the OPA server logs for? Do you have the console decision logger enabled (e.g., One thing we've wanted to do for a little while is get away from the low-level HTTP access logs. Instead, by default, OPA would log INFO & ERROR logs about async operations like bundle downloads and status reports as well as decision logs. The HTTP access logs would be relegated to DEBUG where they rightly belong IMO. Would this satisfy your requirements? EDIT: @patrick-east WDYT? Related: #2173 |
The health check runs every 10 seconds, which is the default frequency for Kubernetes "liveness" probes. We do have the decision logger enabled and that is the actual information we care about retrieving from the OPA server logs. So in our case, yes, relegating HTTP access logs to DEBUG would satisfy our requirements (I also agree it makes more sense for HTTP access logs to fall under DEBUG). Thank you for the response and for your work on this great project! |
Totally agree with @kennethmyers. Health check logs are extremely annoying during troubleshooting even on empty cluster. I usually look there for decision logs or check the @tsandall Your idea with splitting these messages by log levels sounds great to me. |
Hi all, I'm facing the same issue due to Kubernetes running a health check every 10 seconds. However, in my case I'm interested in the HTTP access logs only currently, and I'm already using DEBUG log level, i.e. splitting these messages by log levels would not solve it for me. A way to disable the health check HTTP logs or some way to define a filter for the logs would be great. |
@Treiblesschorle have you looked at the Decision Logging feature? If you run the OPA server with Unfortunately it looks like there was a regression in v0.29.4 around the log level controls but what I would suggest is running OPA with ERROR log level and enabling console decision logging:
This way the decision logs are printed but other debug/info messages are suppressed. We'll fix #3654 for the next release. |
@tsandall It seems that I missed that the decision logs contain the request input and results. In that case, that works for me. Thanks for the reminder. |
This does not appear to be working for me. |
#3654 is fixed with this PR. A new version of OPA with this change will be released this week. cc @Treiblesschorle |
I saw the 0.31.0 version released today. I upgraded and can confirm that this is working as expected.
Returns only the decision logs and not the health check logs. Thanks! |
Thanks for confirming this @mvaal ! Closing this issue. |
Whenever the
/health
endpoint is hit, logs such as the following are produced (when running with the defaultlog_level: INFO
):While it is desirable to log HTTP requests in general, logging each and every health check requests floods the logs with useless data, especially when running OPA in a system with frequent health checks such as Kubernetes.
Is there a way to suppress these health check logs, but still keep all other HTTP request logs?
If there is not a way currently, would the maintainers be open to a PR to implement such a feature?
Thanks
The text was updated successfully, but these errors were encountered: