thanos-io / promql-engine

Multi-threaded PromQL engine implementation based on the Volcano paper.
Apache License 2.0
141 stars 54 forks source link

Distribute subqueries #370

Closed fpetkovski closed 9 months ago

fpetkovski commented 9 months ago

Distributing subqueries can be done in the same manner like we can distribute regular matrix selectors. The only difference is that we need to make sure a remote engine has sufficient scope to calculate both the inner and outer query range. To do this, we simply add the two ranges together when calculating the offset for the remote query and based on this we can decide when it is safe to distribute.