Detect missing queries in InfluxDB with Grafana (similar to Prometheus absent_over_time() or present_over_time())

Hi all,

In Prometheus we can use the function absent_over_time() or present_over_time() to detect missing series or gaps in metrics, which is very useful for alerting when a source stops reporting.

Does InfluxDB (v1.x) have any equivalent function or workaround to achieve the same result? I want to detect missing queries/metrics in Grafana dashboards or alerts when data is not being written.

Thanks in advance!

I don’t see the direct 1-1 function but you can get to it by grouping into fixed time buckets and counting points; a count of 0 indicates missing data. Use fill() at the end of GROUP BY to control how empty buckets appear (null, previous, linear, numeric, none) so Grafana can alert on them. See more: InfluxQL functions | InfluxDB OSS v1 Documentation

1 Like

Thank you for your input @suyash

I agree that your proposed workaround is effective.

Sharing the solution here for reference, as shown in the screenshot below.

Explaination:

  • A (a whole week): Count data points, grouped by time and host.
  • D = (MAX(A) > 0): Confirms that at least one time bucket contains data.
  • E = (LAST(A) < 1): Confirms that the most recent time bucket contains no data.
  • F = D * E: Trigger an alert when both D and E are true.

Please feel free to share with me if you have any better solution @suyash

1 Like