How can convert string value to number in grafana alerting (PromQl)

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_id is a string label
  • Metric value is always 1
  • In Grafana alerts, I want to compare the maximum fault_id
  • PromQL functions like max() and topk() only work on metric values, not labels
    I want to know:
  1. Is there any way in PromQL or Grafana Alerting to convert a label string like "106" into a number?
  2. Is there any workaround without modifying the SNMP exporter?