fix: where query param populated on metrics -> log correlation (#729)

Fixes: HDX-1538
This commit is contained in:
Aaron Knudtson 2025-04-01 16:49:11 -04:00 committed by GitHub
parent eaa6bfa966
commit 6dafb87a6a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 21 additions and 3 deletions

View file

@ -0,0 +1,5 @@
---
"@hyperdx/app": patch
---
fix: View Events not shown for multiple series; grabs where clause when single series

View file

@ -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) ? (
<div
className="bg-grey px-3 py-2 rounded fs-8"
style={{