grafana / worldmap-panel

Worldmap panel plugin for Grafana 3.0 that can be overlaid with circles for data points.
MIT License
305 stars 201 forks source link

influxdb flux empty response causes error #320

Open gabor opened 3 years ago

gabor commented 3 years ago

when an influxdb flux query is used to feed data to the worldmap panel, it works fine (worldmap plugin uses the default configuration).

but, when i select a timerange where there is no data (so the flux query returns no data), the worldmap-plugin produces this error message:

Data error
TypeError: Cannot read property 'length' of undefined

the flux-data response contains one empty dataframe, and this seems to be the source of the problem.

to test this, just use a flux-query that returns no data, like:

from(bucket: "mybucket")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "cpu")
  |> filter(fn: (r) => r["_field"] == "usage_idle")
  |> filter(fn: (r) => false)
gabor commented 3 years ago

the issue originally reported in the grafana repo: https://github.com/grafana/grafana/issues/30290