Repository navigation
Conversation
yuminn-k
force-pushed
the
fix-2694-querier-log
branch
2 times, most recently
from
November 18, 2026 21:33
f03dcd0 to
24ee47a
Compare
sandy2008
reviewed
Nov 19, 2026
| // auth middleware, so that the log lines carry the tenant ID. | ||
| logMiddleware := middleware.NewLogMiddleware(logging.GoKit(util_log.Logger), t.Cfg.Server.LogRequestHeaders, t.Cfg.Server.LogRequestAtInfoLevel, nil, strings.Split(t.Cfg.Server.LogRequestExcludeHeadersList, ",")) | ||
| logMiddleware.DisableRequestSuccessLog = t.Cfg.Server.DisableRequestSuccessLog | ||
| router = logMiddleware.Wrap(router) |
Contributor
There was a problem hiding this comment.
Can tracing run before the logger? Otherwise this log can miss the query's trace ID.
yuminn-k
force-pushed
the
fix-2694-querier-log
branch
from
November 20, 2026 00:34
f63bbd5 to
975cb5b
Compare
sandy2008
approved these changes
Nov 29, 2026
sandy2008
left a comment
Contributor
There was a problem hiding this comment.
The new order works (auth, tracing, then the request log), and the trace ID test fails with the old order. The arm64 failure in TestGettingStartedWithGossipedRing looks unrelated. CHANGELOG.md needs a rebase. LGTM.
…e binary mode Signed-off-by: YuMin Kim <[email protected]>
…outer The log middleware reads the trace ID from the request context, so it has to be wrapped inside the tracing middleware, as in the external HTTP server. Signed-off-by: YuMin Kim <[email protected]>
yuminn-k
force-pushed
the
fix-2694-querier-log
branch
from
November 30, 2026 18:27
975cb5b to
1502524
Compare
This branch has not been deployed
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 this PR does:
When the querier runs in the same process as the query-frontend or query-scheduler (including
-target=all), requests served through the internal querier router were not logged. A standalone querier gets the request log from the HTTP server's default middleware chain, but the internal router only got the tracing, auth and header middlewares.This PR moves those middlewares into
Cortex.wrapInternalQuerierRouterand adds the request log middleware (middleware.NewLogMiddleware), built from the same-server.log-request-headers,-server.log-request-at-info-leveland-server.log-request-headers-exclude-listsettings as the server's. It is wrapped inside the auth middleware so the log lines carry the tenant ID.A new test,
TestWrapInternalQuerierRouter_LogsRequests, fails on master (no log output) and passes with this change.Note: in single binary mode the query-frontend already logs the external request, so each request the querier receives from the frontend is now logged as well. This follows from the code path; I did not measure the log volume of a running
-target=allinstance.AI disclosure (per GENAI_POLICY.md): this change was prepared with an AI coding assistant (Claude Code).
Which issue(s) this PR fixes:
Fixes #2694
Checklist
CHANGELOG.mdupdated - the order of entries should be[CHANGE],[FEATURE],[ENHANCEMENT],[BUGFIX]docs/configuration/v1-guarantees.mdupdated if this PR introduces experimental flags