Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

components/query: add a paragraph about filter #6607

Merged
merged 1 commit into from
Aug 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions docs/components/query.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,16 @@ thanos query \

This logic can also be controlled via parameter on QueryAPI. More details below.

### Deduplication on non-external labels

In `v0.31.0` we have implemented an [optimization](../proposals-accepted/20221129-avoid-global-sort.md) which broke deduplication on non-external labels. We think that it was just a coincidence that deduplication worked at all on non-external labels in previous versions.

External labels always override any labels a series might have and this makes it so that it is possible to remove replica labels on series returned by a StoreAPI as an optimization. If deduplication happens on internal labels then that might lead to unsorted series from a StoreAPI and that breaks deduplication.

To fix this use-case, in 0.32.0 we've implemented a cuckoo filter on label names that is updated every 10 seconds. Using it we can detect whether deduplication was requested on internal labels. If that is the case then the series set is resorted before being sent off to the querier. It is strongly recommended to set replica labels which are external labels because otherwise the optimization cannot be applied and your queries will be slower by 20-30%.

In the future we have plans to expose this cuckoo filter through the InfoAPI. This will allow better scoping queries to StoreAPIs.

## Experimental PromQL Engine

By default, Thanos querier comes with standard Prometheus PromQL engine. However, when `--query.promql-engine=thanos` is specified, Thanos will use [experimental Thanos PromQL engine](http://github.com/thanos-community/promql-engine) which is a drop-in, efficient implementation of PromQL engine with query planner and optimizers.
Expand Down
11 changes: 8 additions & 3 deletions docs/proposals-accepted/20221129-avoid-global-sort.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
## Avoid Global Sort on Querier Select
---
type: proposal
title: Avoid Global Sort on Querier Select
status: approved
owner: bwplotka,fpetkovski
menu: proposals-accepted
---

* **Owners:**
* @bwplotka, @fpetkovski
## Avoid Global Sort on Querier Select

* **Related Tickets:**
* https://github.com/thanos-io/thanos/issues/5719
Expand Down
Loading