grafana / worldmap-panel

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

How to group by latitude and longitude using influx 2.0 #306

Open alduxvm opened 3 years ago

alduxvm commented 3 years ago

Hi!

My bucket contains measurements for latitude and longitude, but I cannot seem to group by and therefore no data displays on the plugin in grafana...

My query in flux is as follows:

from(bucket: "heartbeat")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "measurement")
  |> filter(fn: (r) => r["_field"] == "latitude" or r["_field"] == "longitude")
  |> filter(fn: (r) => r["location"] == "v3p-bcs-54b20389fa62")
  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)
  |> yield(name: "last")

If I use another plugin like trackmap I can properly see the position, but I cannot seem to create the proper query using flux for worldmap...

Thanks!

maxdd commented 3 years ago

I think something is definitely broken somewhere. I've tried as well and i can't seem to get anything displayed. Also https://github.com/grafana/worldmap-panel/issues/295

In my case i have the following table

image

from(bucket: "npm-graf")
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["_measurement"] == "ReverseProxyConnections" and r["_field"] == "IP")
  |> group(columns: ["IP", "latitude", "longitude"], mode:"by")
  |> count(column: "_value")

and grafana is configured as such

image

but nothing is shown

maxdd commented 3 years ago

Any help?