Datasource timestamp precision

My sensors provide an epoch timestamp with millisecond granularity, which I pass by MQTT to a remote server running Telegraf, Influxdb & Grafana.
Influx config has precision set for milliseconds;

  # InfluxDB precision for timestamps on received points ("" or "n", "u", "ms", "s", "m", "h")
    precision = "ms" 

and appears to be working OK;

> SELECT last("grid") FROM "iot" WHERE ("device" = 'diverter')
name: iot
time          last
----          ----
1574373726366 163
>

I’m having difficulties displaying data in Grafana, could it be related to the timestamp precision that I’m using, and if so, is there a setting somewhere to enable ms precision??

I don’t think so. Are you sure that your ms timestamp is in the UTC format and not in your local timezone?

Thanks for replying Jan, but isn’t an epoch timestamp independent of timezones?
Sorry, I’m still learning, and can’t find any relevant information in the documentation.

Could someone please confirm that Grafana can handle a 13 digit timestamp (millisecond precision), and if so, does any config need to be changed?
@daniellee @mefraimsson could you clarify please.

1 Like