prometheus alertname pass $value

35 views
Skip to first unread message

Prashant Singh

unread,
Mar 3, 2023, 4:55:31 AM3/3/23
to Prometheus Users
Hi , 

I want to pass value or $value in alertname . it is possible to pass value in alertname .

- alert: SSLCertExpiringSoon $value

--
groups:
- name: Blackbox rules
rules:
- alert: SSLCertExpiringSoon
expr: probe_ssl_earliest_cert_expiry - time() < 86400 * 4
for: 1m
labels:
severity: warning
annotations:
description: "TLS certificate will expire in {{ $value | humanizeDuration }} (instance {{ $labels.instance }})"

Brian Candler

unread,
Mar 3, 2023, 5:27:20 AM3/3/23
to Prometheus Users
The alert name is the fixed identifier of the alert, e.g. "SSLCertExpiringSoon".  It is not dynamic.

What problem are you trying to solve?  There may be a different way to solve it, e.g. using templating in alertmanager at the time the alert is delivered.
Reply all
Reply to author
Forward
0 new messages