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

numeric dataplane frame types #1067

Open
wants to merge 4 commits into
base: dev-3.0.0
Choose a base branch
from
Open

Conversation

yesoreyeram
Copy link
Collaborator

This PR helps to add proper data frame types when the data frame is comply with numeric-wide/numeric-long data frame types.

This will help to handle the scenarios where these result types will be handled properly in alerts, recorded queries, server side expressions etc.

How to test

Before changes

  • Run grafana enterprise version with recorded queries setup
  • Open explore and execute the default json backend url query
  • Try setting up an recorded query out of it and you will see an error like this
image

After changes

  • Same query should produce valid recorded query results as shown below
image

@yesoreyeram yesoreyeram requested a review from a team as a code owner November 27, 2024 00:00
@yesoreyeram yesoreyeram changed the base branch from main to dev-3.0.0 December 1, 2024 23:22
@yesoreyeram yesoreyeram marked this pull request as draft December 1, 2024 23:28
@yesoreyeram yesoreyeram added this to the Version 3.0 milestone Dec 9, 2024
@yesoreyeram yesoreyeram self-assigned this Dec 9, 2024
@yesoreyeram yesoreyeram marked this pull request as ready for review January 16, 2025 09:30

// CanBeNumericLong asserts if the data frame comply with numeric long type
// https://grafana.com/developers/dataplane/numeric#numeric-long-format-numericlong-sql-table-like
func CanBeNumericLong(frame *data.Frame) bool {

Choose a reason for hiding this comment

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

May want to check for absence of labels as well.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Infinity doesn't make use of labels. So we are good to go here.

If we are doing this is outside of infinity, definitely consider this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants