Search code examples
grafanainfluxdb

How do we change the "precision:ms" setting in the Grafana Query Inspector?


I have an InfluxDB database with only x11 data points in it. These data are not displaying correctly (or at least as I would expect) in Grafana when the time between them is shorter than 1ms.

If I insert data points 1 ms apart, then everything works as expected and I see all x11 points at the correct times, as shown below.:

enter image description here

However, if I delete these points and upload new ones but this time one point per 100 μs, then although the data displays correctly in InfluxDB, in Grafana I see only two points in my graph:

enter image description here

It seems like the data is being rounded/binned to the nearest millisecond, an that this is related to the “precision=ms” setting in the query here:

enter image description here

but I cannot find any way to change this setting. What is the correct way to fix this?


Solution

  • You can't configure Grafana to support different time precision for the InfluxDB. It is hardcoded in the source code: https://github.com/grafana/grafana/blob/36fd746c5df1438f27aa33fc74b24be77debc7ff/public/app/plugins/datasource/influxdb/datasource.ts#L364 (It may need to be fixed in multiple places of the source, not only in this one.)

    So the correct way to fix it is to code it, which is of course not in the scope of this question.