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.
TypeScript apmapplication-monitoringdistributed-tracinggogood-first-issuejaegerloglogsmetricsmonitoringnextjsobservabilityopen-sourceopentelemetryprometheusreactreactjsself-hostedtracingtypescript
fix: handle the super set query reset state when changing widgets (#5539)
Vikrant Guptad60daef171f1
diff --git a/frontend/src/container/NewWidget/index.tsx b/frontend/src/container/NewWidget/index.tsxindex ce7bd59cb8..70d667452e 100644--- a/frontend/src/container/NewWidget/index.tsx+++ b/frontend/src/container/NewWidget/index.tsx@@ -79,6 +79,7 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {stagedQuery,redirectWithQueryBuilderData,supersetQuery,+ setSupersetQuery,} = useQueryBuilder();const isQueryModified = useMemo(@@ -548,6 +549,17 @@ function NewWidget({ selectedGraph }: NewWidgetProps): JSX.Element {isNewTraceLogsAvailable,]);+ useEffect(() => {+ /**+ * we need this extra handling for superset query because we cannot keep this in sync with current query+ * always.we do not sync superset query in the initQueryBuilderData because that function is called on all stage and run+ * actions. we do not want that as we loose out on superset functionalities if we do the same. hence initialising the superset query+ * on mount here with the currentQuery in the begining itself+ */+ setSupersetQuery(currentQuery);+ // eslint-disable-next-line react-hooks/exhaustive-deps+ }, []);+useEffect(() => {registerShortcut(DashboardShortcuts.SaveChanges, onSaveDashboard);registerShortcut(DashboardShortcuts.DiscardChanges, onClickDiscardHandler);diff --git a/frontend/src/providers/QueryBuilder.tsx b/frontend/src/providers/QueryBuilder.tsxindex 5e1eda5714..3654ce3ef3 100644--- a/frontend/src/providers/QueryBuilder.tsx+++ b/frontend/src/providers/QueryBuilder.tsx@@ -829,7 +829,7 @@ export function QueryBuilderProvider({unit,}));},- [setCurrentQuery],+ [setCurrentQuery, setSupersetQuery],);const query: Query = useMemo(