sdk
sdk copied to clipboard
When using the flux query in graph panel targets, grid are not displaying.
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
I am using grafana 7.3.3 and influxdb 2.X
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?
@GiedriusS can you help on this ? any update on this...
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.
大佬们。有解决方案嘛