DEV-48075 - Fix missing warning from NoData in prometheus converter #86
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This fix is based on the following:
grafana#93936
It was fixed on a later version on new prometheus client, but relevant for the current one as well.
The Issue
When running queries that return no data , but has warnings attached to it, we will not see the warning.
Even though the resulsts from datasource do contain a warning:
We expect to see:
But instead not seeing any warning, only No Data.
This is confusing since you don't know if there's an actual problem with missing data or the query is too big.
Root Cause
In the prometheus converter we are adding warnings to response on the response frames.
But in case of no-data there are no frames in response, causing nothing to be added.
Suggested Fix
Fix is pretty simple - just add the case where there are no frames in response and create a new frame for warnings and add it there.