With the telegraf gnmi input plugin, in order to use the telegraf timestamps instead of using the devices timestamps:
Here's the fork https://github.com/rski/telegraf that was used for:
influxdata/telegraf#8411
influxdata/telegraf#8420
Until this option will become natively part of Telegraf (influxdata/telegraf#8689), you can build a docker image from this fork:
git clone https://github.com/rski/telegraf
cd telegraf
make docker-image
Or you can build a docker image from this Dockerfile
FROM golang:1.15.6-buster
WORKDIR /go/src
RUN git clone https://github.com/rski/telegraf.git
RUN cd /go/src/telegraf && make
RUN cp /go/src/telegraf/telegraf ../../bin/.
Then, add use_local_timestamp = true
in the [[inputs.gnmi]]
configuration.
There is new update from Telegraf regarding the issue influxdata/telegraf#8411
The solution for this will be to utilize the Starlark processor
There is this example script that can be added to use the current/local timestamp over the field device's timestamp.