grafana / mimir

Grafana Mimir provides horizontally scalable, highly available, multi-tenant, long-term storage for Prometheus.
https://grafana.com/oss/mimir/
GNU Affero General Public License v3.0
3.85k stars 463 forks source link

Support deleting or rewriting series in long-term storage. #4968

Open joeblubaugh opened 1 year ago

joeblubaugh commented 1 year ago

Is your feature request related to a problem? Please describe.

I would like the ability to delete, edit, or replace samples that have already been commited to a long-term storage in these cases:

Describe the solution you'd like

If the Prometheus delete series API was supported, I could address the minimum needs of these cases by removing sensitive or incorrect samples.

For the more complex case: A Mimir feature that makes it possible to replace TSDB blocks in the block index could also be combined with some utilities to download and modify TSDB blocks outside of Mimir itself. The rewrite utilities could be provided by a separate project if they'd be broadly useful to the Prometheus ecosystem. This feature is slightly different than TSDB remote block upload in that it combines new block upload and block deletion into an atomic operation so that the replacement and original block are never queried at the same time by a store-gateway instance.

Describe alternatives you've considered

We've could Rube Goldberg some existing tools to achieve something similar:

  1. Download the block index.
  2. Block-by-block, download a copy and edit it. This would involve the same sort of block edit tools as in the sketch above.
  3. Use delete the block from the long-term storage. I don't know how this affect the bucket index.
  4. Use TSDB remote block upload to replace the block.
liamkinne commented 1 year ago

Is there any progress on this or an ETA?

bluecmd commented 7 months ago

FWIW, I found this guide how to do this in Thanos; https://thanos.io/tip/operating/modify-objstore-data.md/ - might serve as a good inspiration on how to do the same in Mimir?

pstibrany commented 7 months ago

FWIW, I found this guide how to do this in Thanos; https://thanos.io/tip/operating/modify-objstore-data.md/ - might serve as a good inspiration on how to do the same in Mimir?

On a few occasions when we needed this functionality, we did use bucket rewrite tool from Thanos. That only works when one has direct access to the blocks in the long-term storage, and is not usable by end users.

jcdauchy commented 2 months ago

Is it something that will be supported in the future ?

ying-jeanne commented 2 months ago

@zhehao-grafana this is quite similar to the project in planning about remove sensitive data in the object store. Do you think we would support this at least as a CLI anytime soon?

zhehao-grafana commented 2 months ago

I think we would like to support it in the future, but it is on the immediate plan. If any community member in Mimir has time to start the work, we will find people to help review and push it

gfonseca-tc commented 2 days ago

Would love to see that feature implemented as well. We have a lot of use cases for it to be honest. All the mentioned ones + fixing backfilled data that was wrongly uploaded.