Hello,
I am using SNMP Exporter with Prometheus and Grafana.
My switch only exposes fault information as a string label, not as a numeric value.
Example metric:
siemens_fault_text{fault_id="106", siemens_fault_text="Topology change detected."} 1
Problem:
fault_idis a string label- Metric value is always
1 - In Grafana alerts, I want to compare the maximum
fault_id - PromQL functions like
max()andtopk()only work on metric values, not labels
I want to know:
- Is there any way in PromQL or Grafana Alerting to convert a label string like
"106"into a number? - Is there any workaround without modifying the SNMP exporter?