Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

fix: getting first staged query (#3282)

Yevhen Shevchenko37349786f14a
diff --git a/frontend/src/container/LogsExplorerViews/index.tsx b/frontend/src/container/LogsExplorerViews/index.tsx
index 6eb50af93d..66915e811f 100644
--- a/frontend/src/container/LogsExplorerViews/index.tsx
+++ b/frontend/src/container/LogsExplorerViews/index.tsx
@@ -463,9 +463,17 @@ function LogsExplorerViews(): JSX.Element {
(queryData) => queryData.groupBy.length > 0,
);
- return isGroupByExist
- ? data.payload.data.result
- : [data.payload.data.result[0]];
+ const firstEnabledQuery = stagedQuery.builder.queryData.find(
+ (item) => !item.disabled,
+ );
+
+ const firstPayloadQuery = data.payload.data.result.find(
+ (item) => item.queryName === firstEnabledQuery?.queryName,
+ );
+
+ const firstPayloadQueryArray = firstPayloadQuery ? [firstPayloadQuery] : [];
+
+ return isGroupByExist ? data.payload.data.result : firstPayloadQueryArray;
}, [stagedQuery, data, panelType, listChartData]);
return (