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
feat: update page titles for dashboards and alerts (#6706)
Nishanth Arcotc66cd3ce4e3e
diff --git a/frontend/src/pages/AlertDetails/AlertDetails.tsx b/frontend/src/pages/AlertDetails/AlertDetails.tsxindex 5ee95dfce2..29bb8df2f9 100644--- a/frontend/src/pages/AlertDetails/AlertDetails.tsx+++ b/frontend/src/pages/AlertDetails/AlertDetails.tsx@@ -8,7 +8,7 @@ import RouteTab from 'components/RouteTab';import Spinner from 'components/Spinner';import ROUTES from 'constants/routes';import history from 'lib/history';-import { useMemo } from 'react';+import { useEffect, useMemo } from 'react';import { useTranslation } from 'react-i18next';import { useLocation } from 'react-router-dom';@@ -80,6 +80,11 @@ function AlertDetails(): JSX.Element {alertDetailsResponse,} = useGetAlertRuleDetails();+ useEffect(() => {+ const alertTitle = alertDetailsResponse?.payload?.data.alert;+ document.title = alertTitle || document.title;+ }, [alertDetailsResponse?.payload?.data.alert, isRefetching]);+if (isError ||!isValidRuleId ||diff --git a/frontend/src/pages/NewDashboard/DashboardPage.tsx b/frontend/src/pages/NewDashboard/DashboardPage.tsxindex 7da194aad0..befefa88eb 100644--- a/frontend/src/pages/NewDashboard/DashboardPage.tsx+++ b/frontend/src/pages/NewDashboard/DashboardPage.tsx@@ -4,6 +4,7 @@ import NotFound from 'components/NotFound';import Spinner from 'components/Spinner';import NewDashboard from 'container/NewDashboard';import { useDashboard } from 'providers/Dashboard/Dashboard';+import { useEffect } from 'react';import { ErrorType } from 'types/common';function DashboardPage(): JSX.Element {@@ -17,6 +18,11 @@ function DashboardPage(): JSX.Element {(dashboardResponse?.error as AxiosError)?.response?.data?.errorType: 'Something went wrong';+ useEffect(() => {+ const dashboardTitle = dashboardResponse.data?.data.title;+ document.title = dashboardTitle || document.title;+ }, [dashboardResponse.data?.data.title, isFetching]);+if (isError && !isFetching && errorMessage === ErrorType.NotFound) {return <NotFound />;}