Hello,
Prometheus alertmanager is trying to manage the threshold. Since it is a distributed environment, there are several server instances. I have to receive the threshold of memory from the Web and apply it to the alarm manager rule. So I think I can use an external label, but it doesn’t work well.
First, I tried to define the external label by test and deliver it to the rule file, but it didn’t work well. I defined the external label m_ip in the prometheus.yaml file.
global:
scrape_interval: 30s
evaluation_interval: 15s
external_labels:
m_ip: ‘10.55.196.27:38079’
And the label was set up in the alerting area.
alerting:
alert_relabel_configs:
- source_labels: [m_ip]
target_label: m_ip
alertmanagers:- static_configs:
- targets:
- alertmanager:9093
- targets:
- static_configs:
And the rule file is defined as follows, but the value is not applied.
expr: up{instance="{{ $labels.m_ip }}"} == 0
Is my method wrong when I have to receive a threshold from web and apply it to the expr statement?
What should I do at times like this? I ask for advice from experienced people.