Skip to content

Advanced Query Processing Architecture - #7

Closed
akshayutture-augment wants to merge 1 commit into
query-splitting-baselinefrom
query-splitting-enhancements
Closed

Advanced Query Processing Architecture#7
akshayutture-augment wants to merge 1 commit into
query-splitting-baselinefrom
query-splitting-enhancements

Conversation

@akshayutture-augment

@akshayutture-augment akshayutture-augment commented Nov 17, 2025

Copy link
Copy Markdown

No description provided.

…7534)

* Loki query splitting: interpolate queries before execution

* Update tests

* Prettier

* shardQuerySplitting: remove unnecessary call
@github-advanced-security

Copy link
Copy Markdown

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@augmentcode augmentcode Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review completed. 2 suggestions posted.

Comment augment review to trigger a new review at any time.

const queries = request.targets
.filter((query) => !query.hide)
.filter((query) => query.expr)
.map((query) => datasource.applyTemplateVariables(query, request.scopedVars, request.filters));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interpolating after filtering can allow queries whose expr becomes empty post-replacement to slip through; consider re-filtering after .map(...) (or interpolate before filtering) to avoid executing empty expressions. This prevents invalid requests when a placeholder like $var resolves to an empty string.

🤖 Was this useful? React with 👍 or 👎

.filter((query) => query.expr)
.filter((query) => !query.hide);
.filter((query) => !query.hide)
.map((query) => datasource.applyTemplateVariables(query, request.scopedVars, request.filters));

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same concern as in runSplitQuery: if expr becomes empty after applyTemplateVariables, it will pass the pre-map filters; consider re-filtering after .map(...) (or interpolate before filtering) to avoid sending empty expressions. (Related to the similar change in querySplitting.ts.)

🤖 Was this useful? React with 👍 or 👎

@github-actions

Copy link
Copy Markdown

This pull request has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in 2 weeks if no further activity occurs. Please feel free to give a status update or ping for review. Thank you for your contributions!

@github-actions github-actions Bot added the stale label Dec 18, 2025
@github-actions

github-actions Bot commented Jan 1, 2026

Copy link
Copy Markdown

This pull request has been automatically closed because it has not had any further activity in the last 2 weeks. Thank you for your contributions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants