I am creating a Slack alert template with all the labels I want, but the alert is not populating the values of those labels.
{{ define "slack.message" }}
Additional Details:
- Name: {{ .Labels.alertname }}
{{ end }}
Below is the state I want to be in but even the single label is not populating from the alert.
{{ define "slack.title" }}
*Severity:* `{{ .Labels.severity }}`
*Cluster:* `{{ .Labels.cluster }}`
*Summary:* {{ .Annotations.summary }}
*Description:* {{ .Annotations.description }}
*Additional Details:*
- *Name:* `{{ .Labels.alertname }}`
- *Pod:* `{{ .Labels.pod }}`
- *Namespace:* `{{ .Labels.namespace }}`
- *Service:* `{{ .Labels.service }}`
- *Container:* `{{ .Labels.container }}`
- *Endpoint:* `{{ .Labels.endpoint }}`
- *Route:* `{{ .Labels.route }}`
- *Method:* `{{ .Labels.method }}`
- *Status-Code:* `{{ .Labels.status_code }}`
{{ end }}
Below is the labels I see from Alert.
This is how I see the alert after applying the simple slack template with just alert name in it.
Thanks