Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.
Sign upLabels from alertmanager are empty #2443
Comments
This comment has been minimized.
This comment has been minimized.
|
Do you have a host label on the data? See also https://www.robustperception.io/controlling-the-instance-label/ |
brian-brazil
added
the
kind/question
label
Feb 22, 2017
This comment has been minimized.
This comment has been minimized.
|
@brian-brazil I have the following in my kubernetes configmap https://gist.github.com/craigwillis85/af3411ad393580bad1cf68e28bb03c41 Where would I add the instance label in my configuration? Thanks |
This comment has been minimized.
This comment has been minimized.
|
That doesn't appear to be creating a host label. Try using the instance label in your alert. |
This comment has been minimized.
This comment has been minimized.
|
I've used the instance label, which was also blank. I see in alert manager the following: description xx.xx.xx.xx has high cpu activity So, it seems that I'm getting the right description/summary in alertmanager
I added the following to my
|
This comment has been minimized.
This comment has been minimized.
|
It's not possible for the instance label to be blank with your setup. Can you share your full configs? |
This comment has been minimized.
This comment has been minimized.
|
https://gist.github.com/craigwillis85/310e50fbea652bb2bdf0def31fb17701 These are my alertmanager and prometheus configs |
This comment has been minimized.
This comment has been minimized.
|
You're using CommonAnnotations, so you'll only see the description is only one instance is affected. |
This comment has been minimized.
This comment has been minimized.
|
Should I remove that part from the |
This comment has been minimized.
This comment has been minimized.
|
You could, what you probably want is to range over the Alerts and pull out the annotations from there. |
This comment has been minimized.
This comment has been minimized.
|
How do i range over the alerts? |
This comment has been minimized.
This comment has been minimized.
|
There's some examples in https://github.com/prometheus/alertmanager/blob/master/template/default.tmpl |
This comment has been minimized.
This comment has been minimized.
|
Ok, i managed to get something working:
This displays what i want in slack @brian-brazil thanks for your help |
craigwillis85
closed this
Feb 22, 2017
This comment has been minimized.
This comment has been minimized.
lock
bot
commented
Mar 23, 2019
|
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
craigwillis85 commentedFeb 22, 2017
What did you do?
I created an alert in my prometheus config to post some basic information about node CPU
What did you expect to see?
mynode.com has high cpu activitywhere mynode.com is the hostname of my nodeWhat did you see instead? Under which circumstances?
has high cpu activitythe host part of the $labels.host is blankPrometheus version:
I'm using the latest
(prom/prometheus:latest)Alertmanager version:
I'm using the latest
(prom/alertmanager:latest)An example of the alert is:
I get the alert in slack, but the
hostis blank