InfluxDB-query results are being rounded to integers by Grafana starting October?!

Good evening everyone. This is the weirdest bug I’ve ever encountered (if it’s a bug):
I’m using Grafana V10.2.1 with a connection to my InfluxDB2.
A minimal representation of my query is the following:

from(bucket: "solarLongtermV2")
  |> range(start: -6mo)
  |> filter(fn: (r) => r._measurement == "powerProduction" and r._field == "YieldTotal")

This SHOULD give me for each day in the last 6 month the float-value of “YieldTotal”.
However: If I look at the result, the values are correct up until September 30th. Beginning of October 1st, the values are not the precise values anymore, but are rounded to integers (and as you can see there is no such command in the query or anything).
Before you say it: NO the data is correct in the database, because if I run the same query in the interface of influxDB itself I receive the precise values, so it’s really a Grafana-thing.
But how? How can it be that Grafana decides to round to integers if the data has a _time-stamp of October and later? I’m super confused.

Welcome @dreistein75

Please post a screen capture of the issue

Sure thing! I hope this is what you were asking for. If not I’m happy to provide anything :slight_smile:

1 Like

Additional: A screenshot of InfluxDB itself (where you can see the values are fine until October 1st).

1 Like

What happens if in grafana you change the Decimal property to 3?

Thanks for the response. Can you guide me to the place where I can set this?

You responded as soon as I posted which tells me you didn’t look for that property :joy: look for it then if stuck respond back

you are correct. That’s because I worked quite intensively with Grafana in the recent past and I cannot remember ever seeing this setting. That’s why I knew I probably should ask :wink:

That said, I will try to find it. Thanks for your hint :innocent:

1 Like

@yosiasz it seems that indeed I can’t find it anywhere. I’ve looked through data-source settings, in the dashboard settings (json), in Grafana-Administration I scrolled throw this huge list of settings, … Nowhere can I find anything with “decimal”, except in the settings of a single panel itself, but that does not change anything (as expected because I guess that is only affecting the final visualisation of the panel)

but I see what you’re getting at: It seems that by a stupid coincidence this “rounding” occurs not only when the month jumps to October, but also when the number becomes 3-digits…

I did not see this at the time I asked here (although it is so obvious. whoops.). That indeed sounds like a waaaay more plausible cause than the month… :sweat_smile:

1 Like

ah. Okay, so this is really the decimal setting you were talking about?
I even set that to 15, but it has no effect.

is your data source with the 3 decimals truly float or is it string? How is it being populated? Can you share the code that populates it?

The data gets inserted by telegraf. I guess that code would not be very insightful here.
But: Flux is very strict about types. If the value would be a string, then it would not be possible to e.g. add 0.1 to each value, but since this is possible, the type has to be float. I mean Flux is so strict that it even forbids adding/comparing float and int…
I’ve attached a screenshot where you can see that I can add the 0.1 (also the changed decimals)

edit: PS: This mapping which adds 0.1 does take effect, if you look at the values of September, the value actually was increased by 0.1 in comparison with the unmodified data (from the beginning of this thread)

1 Like

the data preview might be showing the “Wrong” thing but the graph shows the proper decimals with the Decimal setting of 3