I have this job inside prometheus.
- targets: [10.10.10:9182] # fake IP just for this example.
relabel_configs:- source_labels: [address]
target_label: instance - action: replace
source_labels: [windows_cs_hostname]
target_label: hostname
- source_labels: [address]
What I want is when alerts appears in my msteams its shows hostname instead of the server IP.
Also this is the alert: - alert: ‘[Windows] High Physical Memory More than 95%’
annotations:
description: High physical memory usage in instance {{$labels.hostname}}
expr: “100 * (windows_cs_physical_memory_bytes{job="prometheus-windows-JS"}
- windows_os_physical_memory_free_bytes{job="prometheus-windows-JS"}) \n/
windows_cs_physical_memory_bytes{job="prometheus-windows-JS"} > 95 \n”
for: 5m
labels:
severity: demoteams
and this is screenShot of alert result: