I managed to get it work by simply recreating a new visualisation. The query is the simplest one. I guess it confirms a bug in Grafana.
i dont think it is a bug. the issue seems to be with your query. for one thing you have duplicate rows with timestamp for devices that are stationary. if that is indeed a requirement then you have to select the latest row of each devide based on timestamp or remove the timestamp from your query and do a distinct
My 2 visualisations are now strictly identical, the queries are the same. One works, the other don’t. I believe Geomap does not clean up properly its memory from the older queries and prevents it from working with the new right query.
can you prove that technically or is that a gut feeling?
Wanted to add some context here as i also use Geomap with Influx with the Flux query Language
We use this to track our semi trucks around the country, the screenshot for today is a bad example as we only have one semi on the road today but it gives an idea.
We had issues at first where it would show each new data point for each device, as a new marker the two queries and transformations seemed to fix the issue for us.
Let me know if its of any use to you i suppose.
I had to use two queries to make it all work nicely:
QueryA `
from(bucket: “raven”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == “RavenLocationRaven” and
r._field == “latitude” and
r.device == “tablet”
)
|> group(columns: [“host”])
|> last()
|> map(fn: (r) => ({ r with latitude: r._value }))
|> group() // Ungroup to bring back the default grouping
QueryB
from(bucket: “raven”)
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r._measurement == “RavenLocationRaven” and
r._field == “longitude” and
r.device == “tablet”
)
|> group(columns: [“host”])
|> last()
|> map(fn: (r) => ({ r with longitude: r._value }))
|> group() // Ungroup to bring back the default grouping
and a few transformations
great stuff. you can also do it in one swoop with pivot
from(bucket: "raven")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r["_measurement"] == "RavenLocationRaven")
|> filter(fn: (r) => r._field == "device" or r._field == "longitude" or r._field == "latitude")
|> pivot(rowKey:["_time"], columnKey: ["_field"], valueColumn: "_value")
|> group()
|> drop(columns: ["_start", "_stop", "_measurement"])
Ahhhh that is good to know! im not extremely familiar with flux, im a Prometheus/Mimir guy primarily but thats good to know for sure! im literally only using influx for this one usecase ![]()
I always use Inflxudb (but mine is 1.8+ version) I never upgraded to V2 since I don’t need it. And since 1.8, I only use InfluQL, which is pretty straight forward and never get trouble to geomap eversince:
SELECT value, latitude, longitude FROM "My Measurement" WHERE $timeFilter ORDER BY time DESC LIMIT 1
This query will give me the latest value of my data.



