Create separate emails for each instance alert

82 views
Skip to first unread message

talk...@gmail.com

unread,
Sep 6, 2018, 11:22:26 AM9/6/18
to Prometheus Users
Hello,

Leveraging Labels from my Prometheus Rules I'm able to generate seperate emails for different label types.
However, when the Rules fire I receive an email with all instances configured with that label. Is there a way
to generate a separate alert for each instance when the Rule fires? Plans are to send the email to our ticketing
system, and I need a one for one solution to avoid bundling multiple alerts into one ticket. If not, I'll need
to leverage the ticketing solution to parse for delimiters to generate a ticket for each instance. Thank You 
in advance for any help. 


Labels
alertname = node-mem-usage
app = prometheus
chart = prometheus-6.2.1
component = node-exporter
heritage = Tiller
instance = xxx.xxx.xxx.xx2:9100
io_cattle_field_appId = prometheus
job = kubernetes-service-endpoints
kubernetes_name = prometheus-node-exporter
kubernetes_namespace = prometheus
release = prometheus
type = node-mem-usage
Annotations
description = xxx.xxx.xxx.xx2:9100 High Node Memory Percentage Usage.
Source

Labels
alertname = node-mem-usage
app = prometheus
chart = prometheus-6.2.1
component = node-exporter
heritage = Tiller
instance = xxx.xxx.xxx.xx1:9100
io_cattle_field_appId = prometheus
job = kubernetes-service-endpoints
kubernetes_name = prometheus-node-exporter
kubernetes_namespace = prometheus
release = prometheus
type = node-mem-usage
Annotations
description = xxx.xxx.xxx.xx1:9100 High Node Memory Percentage Usage.

Brian Brazil

unread,
Sep 6, 2018, 11:25:59 AM9/6/18
to talk...@gmail.com, Prometheus Users
On 6 September 2018 at 16:22, <talk...@gmail.com> wrote:
Hello,

Leveraging Labels from my Prometheus Rules I'm able to generate seperate emails for different label types.
However, when the Rules fire I receive an email with all instances configured with that label. Is there a way
to generate a separate alert for each instance when the Rule fires? Plans are to send the email to our ticketing
system, and I need a one for one solution to avoid bundling multiple alerts into one ticket. If not, I'll need
to leverage the ticketing solution to parse for delimiters to generate a ticket for each instance. Thank You 
in advance for any help. 

in the group_by in your alertmanager.yml, include every label you want your alerts broken out by. In this case this would be at the least:

group_by: [alertname, instance]

Brian
 

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-users+unsubscribe@googlegroups.com.
To post to this group, send email to prometheus-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/87f4cf7a-5a2f-4f3f-b488-faea478fb424%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

talk...@gmail.com

unread,
Sep 6, 2018, 12:10:16 PM9/6/18
to Prometheus Users
Perfect. That did it Brian. Thanks For Your Help.
Reply all
Reply to author
Forward
0 new messages