diff --git a/.changeset/thirty-ghosts-drop.md b/.changeset/thirty-ghosts-drop.md new file mode 100644 index 00000000..a8303410 --- /dev/null +++ b/.changeset/thirty-ghosts-drop.md @@ -0,0 +1,5 @@ +--- +"@hyperdx/app": patch +--- + +fix: View Events not shown for multiple series; grabs where clause when single series diff --git a/packages/app/src/components/DBTimeChart.tsx b/packages/app/src/components/DBTimeChart.tsx index 297ba422..0fcbbbda 100644 --- a/packages/app/src/components/DBTimeChart.tsx +++ b/packages/app/src/components/DBTimeChart.tsx @@ -149,10 +149,20 @@ export function DBTimeChart({ const to = add(clickedActiveLabelDate, { seconds: convertGranularityToSeconds(granularity), }).getTime(); + let where = config.where; + let whereLanguage = config.whereLanguage || 'lucene'; + if ( + where.length === 0 && + Array.isArray(config.select) && + config.select.length === 1 + ) { + where = config.select[0].aggCondition ?? ''; + whereLanguage = config.select[0].aggConditionLanguage ?? 'lucene'; + } return new URLSearchParams({ source: (isMetricChart ? source?.logSourceId : source?.id) ?? '', - where: config.where, - whereLanguage: config.whereLanguage || 'lucene', + where: where, + whereLanguage: whereLanguage, filters: JSON.stringify(config.filters), from: from.toString(), to: to.toString(), @@ -213,7 +223,10 @@ export function DBTimeChart({ top: 0, }} > - {activeClickPayload != null && qparams != null ? ( + {activeClickPayload != null && + qparams != null && + // only View Events for single series + (!Array.isArray(config.select) || config.select.length === 1) ? (