Skip to content

feat(logs): Support multiple visualizes and groupbys in logs #97912

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

Zylphrex
Copy link
Member

This adds support in logs to allow users to add multiple visualizes and groupbys.

This adds support in logs to allow users to add multiple visualizes and groupbys.
@github-actions github-actions bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Aug 14, 2025
@Zylphrex Zylphrex marked this pull request as ready for review August 15, 2025 00:19
@Zylphrex Zylphrex requested a review from a team as a code owner August 15, 2025 00:19
throw new Error('single visualize only');
}
const aggregate = visualizes[0].yAxis;
const aggregate = visualizes[0]?.yAxis;
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Streaming Data Mismatch Across Visualizations

When multiple visualizes are configured without group-bys, only the first visualize receives streaming updates. The buffer creation logic incorrectly uses only the first visualize's y-axis to store streaming data, while the merging logic attempts to apply this data to all visualizes. This mismatch causes other visualizes to display static or incorrect streaming data.

Fix in Cursor Fix in Web

let minBucketIndex = timeseriesLastBucketIndex;
if (!Array.isArray(originalGroupedTimeSeries) || !targetLength) {
return timeseriesResult.data;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Bug: Aggregate Processing Halts on Malformed Data

The useStreamingTimeseriesResult function prematurely returns from the aggregate processing loop if any single aggregate's data is malformed. This prevents other valid aggregates from being processed and discards any previously merged data.

Fix in Cursor Fix in Web

(columns: string[], op: 'insert' | 'update' | 'delete' | 'reorder') => {
// automatically switch to aggregates mode when a group by is inserted/updated
if (op === 'insert' || op === 'update') {
setGroupBys(columns); // TODO: auto switch to aggregates mode
Copy link
Member

Choose a reason for hiding this comment

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

Did you mean to do this TODO? Or leaving it for a future PR?

Copy link
Member Author

Choose a reason for hiding this comment

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

leaving it for future PR

throw new Error('single visualize only');
}
const aggregate = visualizes[0].yAxis;
const aggregate = visualizes[0]?.yAxis;
Copy link
Member

Choose a reason for hiding this comment

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

This will only 'stream' on the first visualize, if there are two, might be pretty weird, we should set the unsupported_aggregation preflight if there are >1 visualizes too, or we should allow autorefresh but specifically disable streaming the result, or allow auto-refresh to be turned on, but no longer do live streaming of the table data

Copy link
Member Author

Choose a reason for hiding this comment

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

the only aggregate that should ever make it here is count(message), all other aggregates should disable the auto-refresh button

@@ -12,6 +12,8 @@ import {decodeList} from 'sentry/utils/queryString';
import {determineDefaultChartType} from 'sentry/views/explore/contexts/pageParamsContext/visualizes';
import {ChartType} from 'sentry/views/insights/common/components/chart';

export const MAX_VISUALIZES = 4;
Copy link
Member

Choose a reason for hiding this comment

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

😄

@Zylphrex Zylphrex merged commit e9ad12f into master Aug 15, 2025
45 checks passed
@Zylphrex Zylphrex deleted the txiao/feat/support-multiple-visualizes-and-groupbys-in-logs branch August 15, 2025 17:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scope: Frontend Automatically applied to PRs that change frontend components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants