-
-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
feat(logs): Support multiple visualizes and groupbys in logs #97912
Conversation
This adds support in logs to allow users to add multiple visualizes and groupbys.
throw new Error('single visualize only'); | ||
} | ||
const aggregate = visualizes[0].yAxis; | ||
const aggregate = visualizes[0]?.yAxis; |
There was a problem hiding this comment.
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.
let minBucketIndex = timeseriesLastBucketIndex; | ||
if (!Array.isArray(originalGroupedTimeSeries) || !targetLength) { | ||
return timeseriesResult.data; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😄
This adds support in logs to allow users to add multiple visualizes and groupbys.