IMHO this will create more problems, here is a list of my doubts/problems:
- Your data won’t be kept for a longer time since the RP is the same as the original
- You won’t be able to aggregate, insert new points and then delete the “not aggregated ones”. (I have no clue about how to do that, but operations like Update and deletes are discouraged and should be avoided)
- If you insert the aggregated points in the same measurement as the old ones you won’t be able to query only the correct points unless you can identify the two different sets (using a tag). If the points get mixed the data won’t be usable. (this is based on the problem of the second point, the delete)
Can you have some delay in Grafana? (ie: data updated every 1/2 minutes instead of every second)
If the answer is “yes” a continuous query with the advanced syntax will allow you to compute an aggregation and update its result in an “incremental” way.
As an example you will be able to:
Compute the “Average CPU Use %” of the last 5min every 1min
The final result will be:
- A series with a data point every 5min
- The last point will be recalculated 5 times and it’s value updated, based on the values in the 5min range, even if you don’t have 5min of data yet. (the first time the avg will be computed on 1min of data, the second time on 2min and so forth until the interval ends and the value is not overridden anymore)
Have a look at the link above to have a more practical example.
Hope this helps