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

When using the flux query in graph panel targets, grid are not displaying. #138

Open
kittucandy opened this issue Apr 4, 2021 · 6 comments

Comments

@kittucandy
Copy link

I am using Flux 2.X as the datasource.

I have defined the targets in my code like this..

board := sdk.NewBoard("sample")
board.ID = 1
row1 := board.AddRow("Sample row title")
// row1.Add(sdk.NewGraph("Sample graph"))
graph := sdk.NewGraph("Sample graph 2")
strPointer := sdk.MixedSource
graph.Datasource = &strPointer
target := sdk.Target{
	RefID:      "A",
	Datasource: "Influx 2.0",
	Query:      "Flux Query"}
//Query: "select * from"}
graph.AddTarget(&target)
graph.GraphPanel.Xaxis.Show = true
graph.GraphPanel.Yaxes = append(graph.GraphPanel.Yaxes, sdk.Axis{Show: true, Format: "short", LogBase: 1, Decimals: 0})
graph.GraphPanel.Yaxes = append(graph.GraphPanel.Yaxes, sdk.Axis{Show: true, Format: "short", LogBase: 1, Decimals: 0})
row1.Add(graph)

when the post call is made, i can able to see the dashboard and panel created, and targets added successfully with the query and datasource thats defined.. but i am not able to see the graph panel with grid and graph..

When i used the "Expr" instead of "Query" in the targets.. i can able to see grid coming, but the query is not visible..

is there a bug or sdk not not supporting Flux queries?

I am using grafana 7.3.3 and

@kittucandy
Copy link
Author

I am using grafana 7.3.3 and influxdb 2.X

@kittucandy
Copy link
Author

Screenshot 2021-04-05 at 6 55 15 PM

@kittucandy
Copy link
Author

When i create the same manually like adding a panel, graph and datasource and same query.. its working perfectly. Am i doing anything wrong in using the sdk? am i missed passing any values that are required?

@kittucandy
Copy link
Author

@GiedriusS can you help on this ? any update on this...

@GiedriusS
Copy link
Collaborator

Unfortunately but Grafana doesn't fully verify the model before accepting the input so such weird things could happen. I'm not sure when I will have time to get around this but you can help out by trying to create a Grafana dashboard with that panel manually, and comparing what you get with the sdk & what you get after creating the panel manually. This way you could deduce what is missing.

@lpg-it
Copy link

lpg-it commented Jun 25, 2021

大佬们。有解决方案嘛

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

No branches or pull requests

3 participants