Query Mode that Ignores Uncompacted Segments
Is your feature request related to a problem? Please describe.
There is a high volume of segments before they are compacted into blocks - usually within a few minutes.
Segments span many tenants. Compacted blocks encapsulate a single tenant.
Queries reading segments require significantly more work than blocks since they need to query a higher volume of segments. This means more operations to object storage. That translates to higher query latency and cloud costs (which bills you per object storage operation).
Describe the solution you'd like
Queries are faster and cheaper when they ignore segments and only query blocks.
I'd like to see support for a query mode that prevents segments from being queried.
As a server operator, I would actually prefer for this query mode to be the default and for segment queries to require an explicit opt-in via extra API parameter. That's because the query latency and cost delta penalty you pay to query the most recent few dozen seconds of data just isn't the right trade-off for my use cases.
Describe alternatives you've considered
Today, you need to teach clients to only query up to now() - <time> to avoid query/cost penalties associated with reading segments data. With the profilecli CLI and Profiles Drilldown defaulting to now(), there is no safe-by-default way to get most clients to honor your desire to avoid querying segments.
Source: grafana/pyroscope