Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Alerting: Fix InfluxDB no data returns a frame #55346

Closed
wants to merge 1 commit into from

Conversation

grobinson-grafana
Copy link
Contributor

What this PR does / why we need it:

This is one of two possible fixes for #55085. It changes the InfluxDB plugin to match the behaviour of the Prometheus plugin such that queries that return no data will return no frames instead of a frame with no fields.

Which issue(s) this PR fixes:

Fixes #55085

Special notes for your reviewer:

InfluxDB queries that return no data still return at least one frame,
where as Prometheus queries return no frames.
@grafanabot
Copy link
Contributor

Copy link
Contributor

@kylebrandt kylebrandt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to go the other way here and keep the single frame -- targeting that by v10 (data plane contract -- https://github.com/grafana/grafana-plugin-sdk-go/blob/main/data/contract_docs/contract.md#no-data-and-empty).

The primary reason for this is Frame Metadata, in particular we need it for information returned by the backend about queries that were made:

  • ExecutedQueryString (post "raw/text query" macro expansion in various datasources)
  • More future - the type identifier, so we in some cases we may know that

(Then reduce should handle NoData inputs that have a frame attached instead of erroring on them). Been a bit since I thought about that so not sure of exact behaviors, But NoData into a reduce probably also returns NoData (and then math probably needs to handle it to).

@grobinson-grafana
Copy link
Contributor Author

Thank you! I wasn't sure if there was a purpose behind returning a frame with no fields, but I understand its for the metadata!

@github-actions github-actions bot removed this from the 9.2.0 milestone Sep 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Grafana 9.1.4 NoData reduce problem
3 participants