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: do not send query_range api call on every keystroke (#5613)

Vikrant Gupta220edd139a17
diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsx
index 3654ce3ef3..c3b50bbc7e 100644
--- a/frontend/src/providers/QueryBuilder.tsx
+++ b/frontend/src/providers/QueryBuilder.tsx
@@ -27,7 +27,7 @@ import { createIdFromObjectFields } from 'lib/createIdFromObjectFields';
import { createNewBuilderItemName } from 'lib/newQueryBuilder/createNewBuilderItemName';
import { getOperatorsBySourceAndPanelType } from 'lib/newQueryBuilder/getOperatorsBySourceAndPanelType';
import { replaceIncorrectObjectFields } from 'lib/replaceIncorrectObjectFields';
-import { get, merge, set } from 'lodash-es';
+import { cloneDeep, get, merge, set } from 'lodash-es';
import {
createContext,
PropsWithChildren,
@@ -532,7 +532,7 @@ export function QueryBuilderProvider({
if (!panelType) {
return newQueryItem;
}
- const queryItem = item as IBuilderQuery;
+ const queryItem = cloneDeep(item) as IBuilderQuery;
const propsRequired =
panelTypeDataSourceFormValuesMap[panelType as keyof PartialPanelTypes]?.[
queryItem.dataSource