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: redirect to docs on clicking alert setup guide in create alert page (#6265)
Shaheer Kochai92cdb36879b3
diff --git a/frontend/src/container/FormAlertRules/index.tsx b/frontend/src/container/FormAlertRules/index.tsxindex 9b33198ff7..05c4149d73 100644--- a/frontend/src/container/FormAlertRules/index.tsx+++ b/frontend/src/container/FormAlertRules/index.tsx@@ -73,6 +73,19 @@ export enum AlertDetectionTypes {ANOMALY_DETECTION_ALERT = 'anomaly_rule',}+const ALERT_SETUP_GUIDE_URLS: Record<AlertTypes, string> = {+ [AlertTypes.METRICS_BASED_ALERT]:+ 'https://signoz.io/docs/alerts-management/metrics-based-alerts/?utm_source=product&utm_medium=alert-creation-page',+ [AlertTypes.LOGS_BASED_ALERT]:+ 'https://signoz.io/docs/alerts-management/log-based-alerts/?utm_source=product&utm_medium=alert-creation-page',+ [AlertTypes.TRACES_BASED_ALERT]:+ 'https://signoz.io/docs/alerts-management/trace-based-alerts/?utm_source=product&utm_medium=alert-creation-page',+ [AlertTypes.EXCEPTIONS_BASED_ALERT]:+ 'https://signoz.io/docs/alerts-management/exceptions-based-alerts/?utm_source=product&utm_medium=alert-creation-page',+ [AlertTypes.ANOMALY_BASED_ALERT]:+ 'https://signoz.io/docs/alerts-management/anomaly-based-alerts/?utm_source=product&utm_medium=alert-creation-page',+};+// eslint-disable-next-line sonarjs/cognitive-complexityfunction FormAlertRules({alertType,@@ -702,6 +715,29 @@ function FormAlertRules({const isRuleCreated = !ruleId || ruleId === 0;+ function handleRedirection(option: AlertTypes): void {+ let url;+ if (+ option === AlertTypes.METRICS_BASED_ALERT &&+ alertTypeFromURL === AlertDetectionTypes.ANOMALY_DETECTION_ALERT+ ) {+ url = ALERT_SETUP_GUIDE_URLS[AlertTypes.ANOMALY_BASED_ALERT];+ } else {+ url = ALERT_SETUP_GUIDE_URLS[option];+ }++ if (url) {+ logEvent('Alert: Check example alert clicked', {+ dataSource: ALERTS_DATA_SOURCE_MAP[alertDef?.alertType as AlertTypes],+ isNewRule: !ruleId || ruleId === 0,+ ruleId,+ queryType: currentQuery.queryType,+ link: url,+ });+ window.open(url, '_blank');+ }+ }+useEffect(() => {if (!isRuleCreated) {logEvent('Alert: Edit page visited', {@@ -752,7 +788,11 @@ function FormAlertRules({)}</div>- <Button className="periscope-btn" icon={<ExternalLink size={14} />}>+ <Button+ className="periscope-btn"+ onClick={(): void => handleRedirection(alertDef.alertType as AlertTypes)}+ icon={<ExternalLink size={14} />}+ >Alert Setup Guide</Button></div>