2025-12-06 16:13 UTC
I'm trying to use InfluxDB with Grafana because I want the `integral()` function it implements in order to accumulate a cubic-feet-per-minute metric over time.
To get `integral()` you must use Flux to query InfluxDB, and holy cow do I not like this.
```
from(bucket: "flowrate")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) => r._measurement == "cfm")
|> filter(fn: (r) => r._field == "gauge")
|> group(columns: ["device"])
```
This is just trying to get the underlying metric before moving on to the calculus. It doesn't work, it prints a bunch of stuff about _value metrics with no data shown.
Why doesn't it work? Fuck me, that's why. If I loved functional programming more I wouldn't be such an idiot now would I?
Replies (0)
No replies.