3

I am using Grafana 9.4 for dashboarding and alerting. I would like to have an alert based on a Prometheus but filter its results against a list of valid values from a SQL query.

I have the equivalent in a panel in my dashboard with:

  • Query A:
    • A Prometheus metric with labels like {tenant="tenant1", ...} and legend set to {{tenant}}. It is set with Table format and Instant type.
  • Query B:
    • A SQL datasource returning a table with fields tenant and is_visible.
  • Tranforms
    1. Merge (combines using field tenant)
    2. Filter data by values (checks for is_visible=1)
    3. Grouping to matrix
      • Column: tenant
      • Row: Time
      • Cell Value Value

Is this possible with alerting?

Marcel Gosselin
  • 4,610
  • 2
  • 31
  • 54
  • In theory: remove query B, transformation and create dashboard variable from the SQL datasource (of course with `is_visible=1` condition) and use that variable in the query A. – Jan Garaj May 16 '23 at 09:50

0 Answers0