Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Description of Prometheus alert.rules not displayed in Slack channel #158

Closed
paulcosma opened this issue Sep 6, 2019 · 7 comments
Closed

Comments

@paulcosma
Copy link

paulcosma commented Sep 6, 2019

Instead of description "docker-host-alpha" test is displayed for all alerts.
[FIRING:1] (docker-host-alpha)

https://imgur.com/a/KDHfgUE

@vinaymorkar
Copy link

Any findings?

@paulcosma
Copy link
Author

Any findings?

no, haven't looked over since

@vinaymorkar
Copy link

Okay..

@johnreytanquinco
Copy link

I copied the whole rules of jenkins_down and use wordpress_down, stop wordpress container and result is the same as yours. This also happens in host rules when I tried to modify the values.

Screen Shot 2020-09-08 at 11 24 57 AM

Though when I first spin up dockprom containers, I received this first alert.
Screen Shot 2020-09-08 at 11 26 37 AM

@saraiva82
Copy link

I have this happening intermittently especially if more than one alert is firing. I have the standard config noted on the docs for alermanager which seem to be pretty solid when compared with the alermanager documentation for slack.

@saiprashanthpantula
Copy link

saiprashanthpantula commented May 31, 2021

You can use this replace alertmanager.yml with this

global:
resolve_timeout: 1m
slack_api_url: 'https://hooks.slack.com/services/Webhooks-Id'

route:
receiver: 'slack-notifications'

receivers:

  • name: 'slack-notifications'
    slack_configs:
    • channel: '#monitoring-instances'
      send_resolved: true
      icon_url: https://avatars3.githubusercontent.com/u/3380462
      title: |-
      [{{ .Status | toUpper }}{{ if eq .Status "firing" }}:{{ .Alerts.Firing | len }}{{ end }}] {{ .CommonLabels.alertname }} for {{ .CommonLabels.job }}
      {{- if gt (len .CommonLabels) (len .GroupLabels) -}}
      {{" "}}(
      {{- with .CommonLabels.Remove .GroupLabels.Names }}
      {{- range $index, $label := .SortedPairs -}}
      {{ if $index }}, {{ end }}
      {{- $label.Name }}="{{ $label.Value -}}"
      {{- end }}
      {{- end -}}
      )
      {{- end }}
      text: >-
      {{ range .Alerts -}}
      Alert: {{ .Annotations.title }}{{ if .Labels.severity }} - {{ .Labels.severity }}{{ end }}

      Description: {{ .Annotations.description }}

      Details:
      {{ range .Labels.SortedPairs }} • {{ .Name }}: {{ .Value }}
      {{ end }}
      {{ end }}

Alerts may look like this below

image

@nightah
Copy link
Collaborator

nightah commented Aug 26, 2021

Also related to #192.

@nightah nightah closed this as completed Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants