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: query operator (#2924)

Yevhen Shevchenko7f05ce3d050e
diff --git a/frontend/src/hooks/queryBuilder/useQueryOperations.ts b/frontend/src/hooks/queryBuilder/useQueryOperations.ts
index bbbc12ffd5..b1d2f35c18 100644
--- a/frontend/src/hooks/queryBuilder/useQueryOperations.ts
+++ b/frontend/src/hooks/queryBuilder/useQueryOperations.ts
@@ -132,12 +132,20 @@ export const useQueryOperations: UseQueryOperations = ({ query, index }) => {
if (JSON.stringify(operators) === JSON.stringify(initialOperators)) return;
setOperators(initialOperators);
- handleChangeOperator(initialOperators[0].value);
+
+ const isCurrentOperatorAvailableInList = initialOperators
+ .map((operator) => operator.value)
+ .includes(aggregateOperator);
+
+ if (!isCurrentOperatorAvailableInList) {
+ handleChangeOperator(initialOperators[0].value);
+ }
}, [
dataSource,
initialDataSource,
panelType,
operators,
+ aggregateOperator,
handleChangeOperator,
]);