Reputation: 4716
I am using Grafana 9.4 for dashboarding and alerting. I currently have an alert set up with:
{tenant="tenant1", ...}
and legend set to {{tenant}}
.WHEN last() of A is above 100
When triggering, the alert currently generates a notification similar to:
Firing
Value: B0=222.28333333333333
Labels:
- alertname = My alert name
- grafana_folder = My folder
- team = my-team
Annotations:
- summary = My summary
...
B0
in the notification with the actual tenant name from query A?Upvotes: 3
Views: 5523
Reputation: 28626
You have to use Grafana unified alerting (not old Grafana legacy alerting).
tenant
labelOperation: Reduce
, Function: Last
Operation: Math
, Expression: $B>100
Set alert condition: C - expression.
Use Preview alerts
to verify that all labels are generated correctly.
Tenant label will be available in the alert labels
section. Of course you can use it as {{ $labels.B.tenant}}
in the alert Description
or Summary
field.
Upvotes: 4