monitoring: silence loki-gateway 2xx access logs#335
Open
open-dave wants to merge 1 commit into
Open
Conversation
Set gateway.verboseLogging=false so the nginx proxy logs only non-2xx/3xx responses. This drops the successful 204 POST /loki/api/v1/push lines Alloy generates on every push (~⅓ of the monitoring namespace's pod-log volume) at the source, with no loss of error visibility. Closes #326 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What & why
loki-gateway(the Loki chart's bundled nginx proxy) was logging an access-log line for every successful204 POST /loki/api/v1/pushfrom Alloy — roughly 8,600 lines/hour, about a third of themonitoringnamespace's pod-log volume and ~20% of total pod-log ingest. Loki was logging the act of shipping logs, then shipping those logs again, at zero diagnostic value.Set
gateway.verboseLogging: falsein the Loki Helm values. In chart v7.0.0 this switches the gateway nginx config from unconditionalaccess_logtoaccess_log ... if=$loggablewith amap $status $loggableblock that drops 2xx/3xx — silencing successful pushes at the source while retaining error/non-2xx visibility. One-line values change, no custom nginx snippet to maintain.Closes #326
Review
Verified against the pinned
grafana/lokichart v7.0.0 thatgateway.verboseLoggingexists and its_helpers.tplrenders themap $status $loggable { ~^[23] 0; default 1; }gate when false; confirmed no new yamllint issues introduced. Implementation matches the plan; no changes needed.🤖 Generated with Claude Code