How to get the last time a measurement was updated

Hello, in my job we are using influxdb 1.8.10 to store time series. We have two types of series that we store, live and historical. I think live is self-explanatory enough.

With historical time series, we take some past data and generate some derivative time series based on that, which we use to evaluate some processes. The details don’t matter really.

The point is that we can have a time series whose time stamps are for example in 2020 that was generated last week and another one with the same timestamps but generated a year ago. Each one is stored in its own measurement.

Is there any way to know when it was the last time the measurements were updated? That would solve a lot of problems we have with clean up.

If there is no way to do that in the default setup, can it be done for future measurements? What is mean is whether there is a way to tell influxdb to store somewhere the timestamp when a measurement was updated each time new data are stored.

Any solution is welcome.

Hello @tugom,
Unfortunately this isn’t something that is offered in 1.x.
You would have to periodically check to see if your values have changed or timestamps are new. It’s also challenging because you have to always query for a time range you. You can’t just look at last() value across all of your data.

You can do the latter with 3.x though.

1 Like