Alerting with MySQL datasource

  • What Grafana version and what operating system are you using?
    Grafana 8.0.1

  • What are you trying to achieve?
    I would like to create a rule in Grafana alert where I can use thresholds from a MySQL datasource. I created a PromQL query and an SQL query but I can’t use labels from the PromQL query in the SQL query :



Is there a solution to use a condition in SQL query with a label from PromQL ?
Example :
SELECT threshold, hostname as host
FROM threshold
WHERE indicateur=‘SpaceUsedPercent_threshold’ AND host={{$ }};

This topic was automatically closed after 365 days. New replies are no longer allowed.