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.

feat: remove hardcode is darkmode value from get anomaly data func (#6245)

Yunus Ma21830132fd9
diff --git a/frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx b/frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx
index 13f654fd10..88eff524c6 100644
--- a/frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx
+++ b/frontend/src/container/AnomalyAlertEvaluationView/AnomalyAlertEvaluationView.tsx
@@ -74,13 +74,13 @@ function AnomalyAlertEvaluationView({
const dimensions = useResizeObserver(graphRef);
useEffect(() => {
- const chartData = getUplotChartDataForAnomalyDetection(data);
+ const chartData = getUplotChartDataForAnomalyDetection(data, isDarkMode);
setSeriesData(chartData);
setAllSeries(Object.keys(chartData));
setFilteredSeriesKeys(Object.keys(chartData));
- }, [data]);
+ }, [data, isDarkMode]);
useEffect(() => {
const seriesKeys = Object.keys(seriesData);
diff --git a/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts b/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts
index 29dfb973b7..695b2c07de 100644
--- a/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts
+++ b/frontend/src/lib/uPlotLib/utils/getUplotChartData.ts
@@ -153,7 +153,8 @@ const processAnomalyDetectionData = (
};
export const getUplotChartDataForAnomalyDetection = (
- apiResponse?: MetricRangePayloadProps,
+ apiResponse: MetricRangePayloadProps,
+ isDarkMode: boolean,
): Record<
string,
{
@@ -163,6 +164,5 @@ export const getUplotChartDataForAnomalyDetection = (
}
> => {
const anomalyDetectionData = apiResponse?.data?.newResult?.data?.result;
- const isDarkMode = true;
return processAnomalyDetectionData(anomalyDetectionData, isDarkMode);
};