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

Docs: Need clarification on Long/Wide Formats #880

Open
1 of 6 tasks
sarahzinger opened this issue Apr 16, 2024 · 4 comments · May be fixed by #1379
Open
1 of 6 tasks

Docs: Need clarification on Long/Wide Formats #880

sarahzinger opened this issue Apr 16, 2024 · 4 comments · May be fixed by #1379
Assignees
Labels
enhancement New feature or request stale type/docs Changes only affect the documentation

Comments

@sarahzinger
Copy link
Member

sarahzinger commented Apr 16, 2024

Which areas does this feature request relate to

  • Create Plugin
  • Sign Plugin
  • Plugin E2E
  • Documentation

Problem

I'm working on a datasource and reading through the long vs wide data frame section and find myself a bit confused by this line:

"Grafana can detect and convert data frames in long format into wide format."

This doesn't happen automatically right? My understanding is that grafana offers some helper functions to make this easier, perhaps we could add docs for that? Or does the timeseries visualization always convert dataframes to wide?

I think it'd also be good to mention here that if developers want to their dataframes to support alerting they need to use wide dataframes

Solution

Maybe link to the wideToLong and longToWide functions? https://github.com/grafana/grafana-plugin-sdk-go/blob/main/data/time_series.go#L210

Alternatives

No response

Additional context

No response

Are you interested in contributing the solution?

  • Yes
  • No
@sarahzinger sarahzinger added the enhancement New feature or request label Apr 16, 2024
@tolzhabayev tolzhabayev added the type/docs Changes only affect the documentation label Apr 19, 2024
@tolzhabayev tolzhabayev moved this from 📬 Triage to 💡 Ideation in Plugins Platform / Grafana Community Apr 22, 2024
@derek-cadzow
Copy link

@josmperez please have a look and unassign if you are unable to fix this one. Thanks!

@josmperez
Copy link
Contributor

Thanks for pointing this out. I'll take a look.

@josmperez
Copy link
Contributor

Need engineer tech review (@andresmgot ?) of this suggested fix.

@josmperez josmperez changed the title Feat: Docs clarification on Long/Wide Formats Docs: Need clarification on Long/Wide Formats Jul 31, 2024
@andresmgot
Copy link
Contributor

I agree that the sentence is a bit confusing, maybe @marefr can correct me if I am wrong but it could clarify:

  • When it says "Grafana can detect ...", I believe it means that "With the Grafana plugin SDK for Go, a plugin can detect ...". That clarifies that it can detect the data frame type if you are using a backend for your plugin (this is, the library is written in go).
  • For detecting and converting a data frame, we could give an example:
		tsSchema := frame.TimeSeriesSchema()
		if tsSchema.Type == data.TimeSeriesTypeLong {
			wideFrame, err := data.LongToWide(frame, nil)
			if err == nil {
				// handle error
			}
			// return wideFrame
		}

Or does the timeseries visualization always convert dataframes to wide?

I don't think this happens but I am no expert of the timeseries visualization so maybe it's the case.

I think it'd also be good to mention here that if developers want to their dataframes to support alerting they need to use wide dataframes

I was not aware of this either.

@github-actions github-actions bot added the stale label Nov 8, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 22, 2024
@github-project-automation github-project-automation bot moved this from 💡 Ideation to 🚀 Shipped in Plugins Platform / Grafana Community Nov 22, 2024
@josmperez josmperez reopened this Dec 4, 2024
@github-project-automation github-project-automation bot moved this from 🚀 Shipped to 💡 Ideation in Plugins Platform / Grafana Community Dec 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale type/docs Changes only affect the documentation
Projects
Status: 💡 Ideation
Development

Successfully merging a pull request may close this issue.

5 participants