Skip to content
This repository has been archived by the owner on Dec 11, 2020. It is now read-only.

Does not work together with the official piechart plugin #77

Open
theodiefenthal opened this issue Mar 30, 2020 · 1 comment
Open

Does not work together with the official piechart plugin #77

theodiefenthal opened this issue Mar 30, 2020 · 1 comment

Comments

@theodiefenthal
Copy link

theodiefenthal commented Mar 30, 2020

I have a report which creates 10 rows, all with the same timestamp but different tags.

I run the following query, to get the data from the last report run:

lastTimestamp = from(bucket: "reports")
  |> range(start: -3d)
  |> filter(fn: (r) => r._measurement == "report1" and r._field == "numPerCategory")
  |> group()
  |> last()
  |> tableFind(fn: (key) => true)
  |> getRecord(idx:0)
  
from(bucket: "reports")
  |> range(start: -3d)
  |> filter(fn: (r) => r._measurement == "report1" 
                       and r._field == "numPerCategory"
                       and r._time == lastTimestamp._time)
  |> group()
  |> yield()

If I run that query in Chronograf, it returns the desired data as a table. In Grafana, the query also works in principle: If I choose a Graph visualization, it shows the data. Of course, it doesn't draw lines, but just 10 points at the same timestamp as expected.

If I choose Pie-Chart and for the query "Format as time series", I get a pie with just one value (The one of the last queried row), not what I expected: A pie with ten values. If I choose "Format as table", the plugin crashes with "TypeError: this.datapoints is undefined".

If I change the very last |> group() to |> group(columns: ["category"]) nothing changes, same result with Format as Table or format as time series.

For reproduction: I'm on Grafana 6.7.1, using the grafana/grafana docker image and use the flux plugin via GF_INSTALL_PLUGINS on a start from scratch today.

@theodiefenthal theodiefenthal changed the title Does not work together with the piechart plugin Does not work together with the official piechart plugin Mar 30, 2020
@theodiefenthal
Copy link
Author

theodiefenthal commented Aug 17, 2020

This issue seems to still exist with latest Grafana 7.1.3 and Influx 1.8.1 and now built-in flux support. I wasn't able to get a visualization to work, even with any kind of Transformations applied to the data.

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

No branches or pull requests

1 participant