grafana: v9
When I was trying to move from prometheus to grafana unified alerting, I found that the grafana alerting functionality was somewhat incomplete
I can’t extract the host information of the alert, I can only send a large whole ugly content
example
**Firing**
Value: [ metric='up{class="testnet-gateway", instance="IP:80", job="testnet", name="gateway-t1-1", region="Falkenstein", service_provider="hetzner"}' labels={__name__=up, class=testnet-gateway, instance=IP:80, job=testnet, name=gateway-t1-1, region=Falkenstein, service_provider=hetzner} value=0 ]
Labels:
- alertname = TestAlert
- instance = Grafana
Annotations:
- summary = Notification test
I just want a short and useful piece of information
**Firing**
Value:
- metric='up
- instance=bar
- name=gateway-t1-1
- region=Falkenstein
Labels:
- alertname = TestAlert
- instance = Grafana
Annotations:
- summary = Notification test
There are only match and reReplaceAll functions in template-functions, but there is no function that matches and returns the content
I don’t know how to implement it, it’s difficult in grafana