CitiLogics / citilogics-geoloop-panel

Animated Maps in Grafana
MIT License
44 stars 6 forks source link

Using with influx 2.0 / flux language. #20

Closed adageable closed 1 year ago

adageable commented 3 years ago

I realize that this hasn't been active for a bit, but I'm hoping to see if anyone has a perspective on using this with Influx 2.0 and Flux language.

Looking at the following from the readme, I see:

Notice the GROUP BY tag(location)? That's super important. It's what causes the data source to spit out the series alias in the format index.mean {location:coyote_creek} - otherwise the location would be hidden, aggregated, or otherwise lost.

Here, there is no alias capabilities in Flux unless you use a custom map function to remap, which I'm not. I'm simply not getting measurements to change the colors of polygons, so I'm assuming that there's something wrong with how this is picking up the Series Geo ID tag when using flux.

For example, currently, my query ends with: |> aggregateWindow(every: 1h, fn: mean, createEmpty: false) |> group(columns: ["loc"]) |> yield()

This should, as I understand it, leave the "loc" field in my dataset, which can then be matched to the properties.loc field from the GeoJSON. Basically, I'm seeing the polygons in my overlay, but they aren't picking up any measured value (which span between 0.0 and 1.0). Any quick thoughts on what might be going on here?

adageable commented 3 years ago

okay, looks like the default alias (post grouping) ends up looking like this in Influx 1.8: $m.myAlias {location:$tag_myLocationTag}. So, for example: index.mean {location: Santa_Barbara}

However, in influx 2.0 / flux querying, it looks like {location="Santa_Barbara"}

I'm assuming that the code in this plugin is somehow parsing that group header, and doesn't know this new output drops the first part, and uses an equals sign instead of a colon.

Does this make any sense?