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 upAdded alert labels cannot be used in annotation #2992
Comments
cubranic
referenced this issue
Jul 25, 2017
Closed
Added alert labels cannot be used in annotation #2454
This comment has been minimized.
This comment has been minimized.
|
This is not supported, nor is it required in this case. You can use |
This comment has been minimized.
This comment has been minimized.
|
This is the minimal case to reproduce, in case that wasn't obvious. The real case is more complicated, but is beside the point here, which is that it would be very useful to use in ANNOTATIONS values that were set in LABELS. Based on the documentation, which says that both can be templated, it was surprising to me that they're totally independent. |
This comment has been minimized.
This comment has been minimized.
|
This has been discussed previously and there's no way to do it that won't cause confusion. The same argument can be made the other way around, and I don't think we want to try and build a partial ordering across annotations and labels. If you share your actual use case we may be able to make suggestions/improvements. |
This comment has been minimized.
This comment has been minimized.
|
Now you say it's been discussed previously, but when I tried to add a point to #2454 you said there that the report is actually about a different use case. Firstly, the semantics doesn't have to be complicated, or involve partial ordering. E.g., labels are fully defined before annotations are added, and all values defined in LABELS are added at once at the end, so that they are not available except in ANNOTATIONS. (Just like variables defined by The use case in mind is having a phrase constructed from several labels of the original alert, and use it in summary and description annotation. Before you say that these should be added by Prometheus as part of the target label:
|
This comment has been minimized.
This comment has been minimized.
If we added that we'd just get complaints that it didn't work the other way. And that it was all done at once. No matter what we do here, someone is going to be unhappy.
Can you be more specific about your use case? There's several directions something like this can be approached from, and I need more detail to know if none of them apply. |
brian-brazil
added
component/rules
wont-fix
labels
Aug 4, 2017
This comment has been minimized.
This comment has been minimized.
|
Without further information about your use case I'll have to presume there's some other better way to resolve your use case. |
brian-brazil
closed this
Aug 4, 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. |
cubranic commentedJul 25, 2017
What did you do?
When I add a label in an alert via LABELS I would like to be able to use it immediately in the annotation, however that doesn't seem to be possible.
What did you expect to see?
I would expect
$labels.wherein the annotation description to be replaced with the value I just set in the LABELS section.What did you see instead? Under which circumstances?
It gets replaced with an empty string.
You can see "where" in the list of labels in the output of
curl -sg '<prom-url>/api/v1/query?query=ALERTS, but the contents posted in the Slack channel is "Instance down".Environment
System information:
Linux 4.4.0-83-generic x86_64
Prometheus version: