In Grafana Tempo, block_retention and compacted_block_retention control how long data is stored. block_retention determines how long blocks (raw trace data) are kept before deletion, while compacted_block_retention determines how long compacted blocks (aggregated trace data) are kept after compaction.
I want to keep Tracelog data for 1 Year so block_retention: 8766h0m0s. I am seeing Queries are slow & Block List Lenght is increasing. Currently its 95k.
As per Google Ans, I understand that, I am not keeping compacted blocks more than 1Hour, may be due to which all blocks are uncompacted due to which queries are slower and block list length is increasing.
If I change compacted_block_retention: 8766h0m0s # 1h Default 1 year, then queries:
Will I able to retain data till 1 Year but in compacted format which will improve query performance & able to query last 1 year data?
Can I change block_retention: 8766h0m0s to 14 days from 1 year to reduce block list length?
block_retention: the amount of time after the data is deleted, i.e it’s retention
compacted_block_retention: The compactor compacted_block_retention is used to keep a block in the backend for a given period of time after it has been compacted and the data is no longer needed. This allows queriers with a stale blocklist to access these blocks successfully until they complete their polling cycles and have up to date blocklists. Like the complete_block_timeout , this should be at a minimum 2x the configured blocklist_poll duration.
I want to keep Tracelog data for 1 Year so block_retention: 8766h0m0s. I am seeing Queries are slow & Block List Lenght is increasing. Currently its 95k.
As you add more blocks to the backend, the blocklist will increase.
I have answer similar questions here, please see those as well.
Compact and scale up compactors, use tempodb_compaction_outstanding_blocks to measure the pending work.
depends a lot on many factors, and workload, I can tell you that we have seen cluster with 1M+ blocklist
Yes, try to compact as much as you can. but at some points you need to look at the cost to compact and cost to query an extra block, sometimes it’s better to scale up read path, sometimes it’s better to scale up compactor. it’s a tradeoff but usually less blocks will means better performance but beyond a blocksize it might impact negatively.
imagine if you had a one block of 1TB, it would be bad for perf. so you need to find a balance and see what works for your workload.