Compare commits

..

1 Commits

Author SHA1 Message Date
nityanandagohain
631e6eefde chore: update alertmanager template 2026-09-16 11:13:25 +05:30
2 changed files with 27 additions and 2 deletions

View File

@@ -20,7 +20,7 @@ export const SlackInitialConfig: Partial<SlackChannel> = {
*Summary:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*RelatedLogs:* {{ if gt (len .Annotations.related_logs) 0 -}} View in <{{ .Annotations.related_logs }}|logs explorer> {{- end}}
*RelatedTraces:* {{ if gt (len .Annotations.related_traces) 0 -}} View in <{{ .Annotations.related_traces }}|traces explorer> {{- end}}
*RelatedTraces:* {{ if gt (len .Annotations.related_traces) 0 -}}{{ if match "/ai-observability" .Annotations.related_traces -}} View in <{{ .Annotations.related_traces }}|ai traces explorer> {{- else -}} View in <{{ .Annotations.related_traces }}|traces explorer> {{- end }}{{- end}}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* {{ .Value }}

View File

@@ -131,7 +131,7 @@ Description: Request rate exceeded 10k/s`},
*Summary:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*RelatedLogs:* {{ if gt (len .Annotations.related_logs) 0 -}} View in <{{ .Annotations.related_logs }}|logs explorer> {{- end}}
*RelatedTraces:* {{ if gt (len .Annotations.related_traces) 0 -}} View in <{{ .Annotations.related_traces }}|traces explorer> {{- end}}
*RelatedTraces:* {{ if gt (len .Annotations.related_traces) 0 -}}{{ if match "/ai-observability" .Annotations.related_traces -}} View in <{{ .Annotations.related_traces }}|ai traces explorer> {{- else -}} View in <{{ .Annotations.related_traces }}|traces explorer> {{- end }}{{- end}}
*Details:*
{{ range .Labels.SortedPairs }} • *{{ .Name }}:* {{ .Value }}
@@ -157,6 +157,31 @@ Description: Request rate exceeded 10k/s`},
" "},
wantIsDefaultBody: true,
},
{
// AI trace alerts link to the ai-observability explorer; the default
// body template labels that link differently from a plain traces link.
name: "old template: ai traces link labelled ai traces explorer",
alerts: []*types.Alert{
createAlert(
map[string]string{ruletypes.LabelAlertName: "HighLLMLatency", ruletypes.LabelSeverityName: "warning"},
map[string]string{
"summary": "LLM latency high",
"description": "p99 latency of LLM calls is high",
"related_traces": "https://signoz.example.com/ai-observability/explorer?startTime=1&endTime=2",
},
true,
),
},
input: alertmanagertypes.ExpandRequest{
DefaultTitleTemplate: `{{ .CommonLabels.alertname }}`,
DefaultBodyTemplate: `{{ range .Alerts -}}
*RelatedTraces:* {{ if gt (len .Annotations.related_traces) 0 -}}{{ if match "/ai-observability" .Annotations.related_traces -}} View in <{{ .Annotations.related_traces }}|ai traces explorer> {{- else -}} View in <{{ .Annotations.related_traces }}|traces explorer> {{- end }}{{- end}}
{{ end }}`,
},
wantTitle: "HighLLMLatency",
wantBody: []string{"*RelatedTraces:* View in <https://signoz.example.com/ai-observability/explorer?startTime=1&endTime=2|ai traces explorer>\n "},
wantIsDefaultBody: true,
},
{
// Pod crash loop on multiple pods — body is expanded once per alert
// and joined with "\n\n", with the pod name pulled from labels.