Error handling for invalid PromQL queries, such as one with unsupported subqueries

Summary

When a query which uses subqueries is requested to Prometheus < 2.7, it will yield a 400 error.

Steps to reproduce

Example of a dashboard: $1903200

What is the current bug behavior?

The metric is not displayed and the doesn't know why. The results are simply not displayed.

What is the expected correct behavior?

User knows about the error

Relevant logs and/or screenshots

Here, 2 metrics are missing, which responded with a 400 error that looks like this:

image

{ "error": "parse error at char 55: range specification must be preceded by a metric selector, but follows a *promql.Call instead", "errorType": "bad_data", "status": "error" }

Possible fixes

Add an error notice relevant to the correct panel, so the use know what failed.

Assignee Loading
Time tracking Loading