Given I can create this example Prometheus metric:
HELP some_metric This is the metric description
TYPE some_metric counter
some_metric{job="foo",instance="a",some_label="value"} 5
I'd like to be able to use the metric description from the HELP
annotation in the Prometheus alert definition like this:
annotations:
description: This is HELP {{ $meta.HELP }}
summary: And this is TYPE {{ $meta.TYPE }}
Note that I am currently interested only in the HELP, but providing TYPE too seems like a logical thing to do.
I know I can use $value
, $labels
, and $externalLabels
variables, but I can see no help/meta or anything.
You can, but you need to do it manually in prometheus rules, it can't be automatic from
expr
like
you could add the description/summary from :
annotations.description
annotations.summary
Hopefully answer your question