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(alerts): alert header breaking with unknown severity (#10730)
Vinicius Lourenço70fdc88112fa
diff --git a/frontend/src/pages/AlertDetails/AlertHeader/AlertSeverity/AlertSeverity.tsx b/frontend/src/pages/AlertDetails/AlertHeader/AlertSeverity/AlertSeverity.tsxindex b744a14d1c..203acc3177 100644--- a/frontend/src/pages/AlertDetails/AlertHeader/AlertSeverity/AlertSeverity.tsx+++ b/frontend/src/pages/AlertDetails/AlertHeader/AlertSeverity/AlertSeverity.tsx@@ -1,3 +1,5 @@+import { useMemo } from 'react';+import * as Sentry from '@sentry/react';import SeverityCriticalIcon from 'assets/AlertHistory/SeverityCriticalIcon';import SeverityErrorIcon from 'assets/AlertHistory/SeverityErrorIcon';import SeverityInfoIcon from 'assets/AlertHistory/SeverityInfoIcon';@@ -5,34 +7,50 @@ import SeverityWarningIcon from 'assets/AlertHistory/SeverityWarningIcon';import './AlertSeverity.styles.scss';+const severityConfig: Record<string, Record<string, string | JSX.Element>> = {+ critical: {+ text: 'Critical',+ className: 'alert-severity--critical',+ icon: <SeverityCriticalIcon />,+ },+ error: {+ text: 'Error',+ className: 'alert-severity--error',+ icon: <SeverityErrorIcon />,+ },+ warning: {+ text: 'Warning',+ className: 'alert-severity--warning',+ icon: <SeverityWarningIcon />,+ },+ info: {+ text: 'Info',+ className: 'alert-severity--info',+ icon: <SeverityInfoIcon />,+ },+};+export default function AlertSeverity({severity,}: {severity: string;}): JSX.Element {- const severityConfig: Record<string, Record<string, string | JSX.Element>> = {- critical: {- text: 'Critical',- className: 'alert-severity--critical',- icon: <SeverityCriticalIcon />,- },- error: {- text: 'Error',- className: 'alert-severity--error',- icon: <SeverityErrorIcon />,- },- warning: {- text: 'Warning',- className: 'alert-severity--warning',- icon: <SeverityWarningIcon />,- },- info: {- text: 'Info',+ const severityDetails = useMemo(() => {+ if (severityConfig[severity]) {+ return severityConfig[severity];+ }++ Sentry.captureEvent({+ message: `Received unknown severity on Alert Details: ${severity}`,+ level: 'error',+ });++ return {+ text: severity,className: 'alert-severity--info',icon: <SeverityInfoIcon />,- },- };- const severityDetails = severityConfig[severity];+ };+ }, [severity]);return (<div className={`alert-severity ${severityDetails.className}`}><div className="alert-severity__icon">{severityDetails.icon}</div>