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 old variables by name instead of id (#4890)
Vikrant Gupta38d2833931f5
diff --git a/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx b/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsxindex 5f770e26d0..1eed8f351f 100644--- a/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx+++ b/frontend/src/container/NewDashboard/DashboardVariablesSelection/DashboardVariableSelection.tsx@@ -72,6 +72,7 @@ function DashboardVariableSelection(): JSX.Element | null {id: string,value: IDashboardVariable['selectedValue'],allSelected: boolean,+ // eslint-disable-next-line sonarjs/cognitive-complexity): void => {if (id) {updateLocalStorageDashboardVariables(name, value, allSelected);@@ -79,17 +80,29 @@ function DashboardVariableSelection(): JSX.Element | null {if (selectedDashboard) {setSelectedDashboard((prev) => {if (prev) {+ const oldVariables = prev?.data.variables;+ // this is added to handle case where we have two different+ // schemas for variable response+ if (oldVariables[id]) {+ oldVariables[id] = {+ ...oldVariables[id],+ selectedValue: value,+ allSelected,+ };+ }+ if (oldVariables[name]) {+ oldVariables[name] = {+ ...oldVariables[name],+ selectedValue: value,+ allSelected,+ };+ }return {...prev,data: {...prev?.data,variables: {- ...prev?.data.variables,- [id]: {- ...prev.data.variables[id],- selectedValue: value,- allSelected,- },+ ...oldVariables,},},};