andymchugh / andrewbmchugh-flow-panel

Apache License 2.0
38 stars 2 forks source link

What are the required fields for Grafana SQL query to work as dataRef input? #104

Closed simonasmulevicius-humbility closed 2 months ago

simonasmulevicius-humbility commented 2 months ago

I know that some plugins require specific field names (like time or value). So I wonder how you pass information from SQL time series query to Flow diagram?

For example, in panel.yml I have:

cellIdPreamble: "cell-"
cells:
  example_server:
    dataRef: "mydataseries"

So I thought that having Grafana Query with the same name will do the job: image

But I am probably missing something...

andymchugh commented 2 months ago

The panel receives your query responses and passes them through the grafana toDataFrame function. There isn't good documentation on how all of the data sources present and get converted to dataFrames so your best bet is to explore the data itself. Where you write the query you should be able to inspect the request and the returned response. If that's not helping then open the browser console and press the panel Debug->Data button. In the console you'll see the data presented to the panel and how it then got enriched by the panel. Play with your query till you understand what terms define the result.

At a guess I'd assume your query would return a dataframe with a dataRef of 'value', but really the only way to know is to look in the data the panel receives.

andymchugh commented 2 months ago

closing as it's gone quiet.