Skip to content

[FEATURE] (plugin-system): optional PromQL query batch coalescing - #322

Draft
colivi wants to merge 2 commits into
perses:mainfrom
colivi:feat/prom-query-batch
Draft

colivi wants to merge 2 commits into
perses:mainfrom
colivi:feat/prom-query-batch

Conversation

@colivi

@colivi colivi commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

Description

Coalesce same-panel multi-query fetches when enabled via dashboard.spec.queryBatching.mode (off|panel|viewport|dashboard), window flag, or localStorage.

Checklist

  • Pull request has a descriptive title and context useful to a reviewer.
  • Pull request title follows the [<catalog_entry>] <commit message> naming convention using one of the
    following catalog_entry values: FEATURE, ENHANCEMENT, BUGFIX, BREAKINGCHANGE, DOC,IGNORE.
  • All commits have DCO signoffs.

Coalesce same-panel multi-query fetches when enabled via
dashboard.spec.queryBatching.mode (off|panel|viewport|dashboard),
window flag, or localStorage. Optional getTimeSeriesDataBatch.
Unit tests for enablement resolution.

Signed-off-by: colivi <charles.olivi@gmail.com>
@colivi
colivi requested a review from a team as a code owner September 28, 2026 08:38

if (batchOn && typeof loaded.getTimeSeriesDataBatch === 'function') {
const sameKind = definitions.filter((d) => d.spec.plugin.kind === definition.spec.plugin.kind);
const batchKey = JSON.stringify({

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This batch key might be missing the fact that there could be different time series datasources in a specific dashboard. Can we test this will not affect a dashboard with different time series datasources configured?

import { afterEach, describe, expect, it } from 'vitest';
import { isQueryBatchEnabled } from './time-series-queries';

describe('isQueryBatchEnabled', () => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

we might be missing test regarding the actual behavior when querying, it seems the current tests are just focused on configuration

@Nexucis
Nexucis marked this pull request as draft September 28, 2026 09:41
@Nexucis

Nexucis commented Sep 28, 2026

Copy link
Copy Markdown
Member

I have put every PRs related to the query batching feature in a draft.
@colivi can you please create an issue so we can discuss about the problem and a design proposition.

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.

3 participants