feat: qlog no-log header for replay traffic#35
Open
andreimarinescu wants to merge 1 commit into
Open
Conversation
Requests whose X-Cosift-No-Log header equals COSIFT_QLOG_NOLOG_TOKEN are served normally but skipped in the query log, so demand-loop replay traffic can be excluded. Unset token = feature off. Plain string compare mirrors the requireAdmin precedent.
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.
Adds
COSIFT_QLOG_NOLOG_TOKEN: when set, a query request whoseX-Cosift-No-Logheader exactly equals the token is served normally but not written to the query log. Unset token = feature off (header ignored).Motivation: the demand-loop's weekly replay batch re-issues logged queries against
/searchto measure servedness. Without an exclusion mechanism those replays land back in the query log and become next cycle's "demand" — the loop pollutes its own signal. This is engine ask #2 (variant B) from the demand-loop design.Notes:
count/rateLimitwrappers still apply, response is unchanged apart fromX-Cosift-Query-Id(not minted for suppressed requests; the qid only feeds feedback⋈qlog joins, which can't include unlogged rows anyway).requireAdminprecedent.COSIFT_QUERY_LOGis set; the production passthrough worker's D1 log needs the equivalent header check separately (coordinated with Teo).docs/ENV.mdupdated; table test covers set/unset token × header present/wrong/absent.