@@ -6,6 +6,16 @@ import {
66 defaultMatchType ,
77} from 'types/api/alerts/def' ;
88
9+ const defaultAlertDescription =
10+ 'This alert is fired when the defined metric (current value: {{$value}}) crosses the threshold ({{$threshold}})' ;
11+ const defaultAlertSummary =
12+ 'The rule threshold is set to {{$threshold}}, and the observed metric value is {{$value}}' ;
13+
14+ const defaultAnnotations = {
15+ description : defaultAlertDescription ,
16+ summary : defaultAlertSummary ,
17+ } ;
18+
919export const alertDefaults : AlertDef = {
1020 alertType : AlertTypes . METRICS_BASED_ALERT ,
1121 condition : {
@@ -38,9 +48,7 @@ export const alertDefaults: AlertDef = {
3848 labels : {
3949 severity : 'warning' ,
4050 } ,
41- annotations : {
42- description : 'A new alert' ,
43- } ,
51+ annotations : defaultAnnotations ,
4452 evalWindow : defaultEvalWindow ,
4553} ;
4654
@@ -85,9 +93,7 @@ export const logAlertDefaults: AlertDef = {
8593 severity : 'warning' ,
8694 details : `${ window . location . protocol } //${ window . location . host } /logs` ,
8795 } ,
88- annotations : {
89- description : 'A new log-based alert' ,
90- } ,
96+ annotations : defaultAnnotations ,
9197 evalWindow : defaultEvalWindow ,
9298} ;
9399
@@ -132,9 +138,7 @@ export const traceAlertDefaults: AlertDef = {
132138 severity : 'warning' ,
133139 details : `${ window . location . protocol } //${ window . location . host } /traces` ,
134140 } ,
135- annotations : {
136- description : 'A new trace-based alert' ,
137- } ,
141+ annotations : defaultAnnotations ,
138142 evalWindow : defaultEvalWindow ,
139143} ;
140144
@@ -179,8 +183,6 @@ export const exceptionAlertDefaults: AlertDef = {
179183 severity : 'warning' ,
180184 details : `${ window . location . protocol } //${ window . location . host } /exceptions` ,
181185 } ,
182- annotations : {
183- description : 'A new exceptions-based alert' ,
184- } ,
186+ annotations : defaultAnnotations ,
185187 evalWindow : defaultEvalWindow ,
186188} ;
0 commit comments