Stat panel showing no data when using last

I have a stat panel that is pulling data from an Influxdb that is being updated every 1s. It’s using this Flux query:

from(bucket: v.bucket)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["Metric"] == "fMeasure")
  |> filter(fn: (r) => r["_field"] == "value")
  |> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: true)

This works, I get a stat panel value and also the underlying graph:

image

As soon as I change the calculation from ‘last value’ to ‘last non-null value’ I start to get flashes of ‘no data’.

If I switch the stat panel to a line graph and look at the underlying data I have no blank periods so I know the data is there.

There’s 3 stats/graphs (not sure how to word this) in the panel and it is always the right hand two that flash up ‘no data’. It feels like it could be a processing performance thing, rather than a lack of data? i.e. it processes the stat graphs from left to right and it’s always the right hand graphs that seem to have an issue.

Any thoughts?

Does changing the aggregateWindow function to this change anything?

  |> aggregateWindow(every: v.windowPeriod, fn: last, createEmpty: false)

Hi @grant2

Sadly not, but whilst playing around it seems that if I remove the aggregation line entirely, everything is fine.

The current query:

from(bucket: v.bucket)
  |> range(start: v.timeRangeStart, stop: v.timeRangeStop)
  |> filter(fn: (r) => r["Metric"] == "fMeasure")
  |> filter(fn: (r) => r["_field"] == "value")

Looking at the stats, the new query takes 20ms longer and pulls in 250 more points, but everything seems to be handling it.

Is there an aggregation option I’m missing?

Sometimes (esp. when your data range is short, or sparsely populated) you do not need the aggregateWindow() function. Are you displaying the Stat Panels to cover a wide range of time? You mentioned that data is being added every 1s, so if you wanted a range of, say, 1 day, that’s a lot of “unaggregated” data.

Hi,

It’s a 1hr period being displayed.