Skip to content

chore(querier): Operate on AST directly in multi-tenant querier - #24137

Draft
chaudum wants to merge 1 commit into
chaudum/query-request-planfrom
chaudum/query-request-plan-pt2
Draft

chore(querier): Operate on AST directly in multi-tenant querier#24137
chaudum wants to merge 1 commit into
chaudum/query-request-planfrom
chaudum/query-request-plan-pt2

Conversation

@chaudum

@chaudum chaudum commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Rework MultiTenantQuerier to operate on the AST directly instead of converting to string and re-parsing.

This is step 2 of the QueryRequest.Selector to QueryRequest.Plan migration (loki-private#2709).

Changes:

  • SelectLogs: Assign modified AST directly to Plan, eliminating the string round-trip (AST → string → parse → AST)
  • SelectSamples: Fix bug where Plan was not being updated after tenant selector removal; now updates Plan with modified AST
  • Remove unused fmt import

Both methods still update Selector for backward compatibility during version-skew rollout.

Rework MultiTenantQuerier to operate on the AST directly instead of
converting to string and re-parsing.

This is step 2 of the QueryRequest.Selector to QueryRequest.Plan migration
(loki-private#2709).

Changes:
- SelectLogs: Assign modified AST directly to Plan, eliminating the
  string round-trip (AST → string → parse → AST)
- SelectSamples: Fix bug where Plan was not being updated after
  tenant selector removal; now updates Plan with modified AST
- Remove unused fmt import

Both methods still update Selector for backward compatibility during
version-skew rollout.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant