Support pre-filtering in multi-level vmselect setup

Author: HaleygoCreated Aug 5, 2026Updated Sep 30, 2026
Labelsenhancementperformancevmselect

Is your feature request related to a problem? Please describe

vmselect nodes can be queried by other vmselect nodes if they run with the -clusternativeListenAddr command-line flag. This allows users to chain vmselect nodes and build multi-level cluster topologies. For example, a top-level vmselect node can query second-level vmselect nodes in different availability zones (AZs), while the second-level vmselect nodes query vmstorage nodes in the local AZ.

The top-level vmselect provides a global entrance for all queries, but it doesn't provide the best efficiency when the data is only located in a limited set of known AZs. AZs without the matching data will still receive the request and need to process it before returning an empty response, which adds unnecessary load and can slow down the query if an AZ is slow to respond.

Describe the solution you'd like

It would be nice to support pre-filtering together with the -clusternativeListenAddr flag on vmselect. For example:

// region vmselect:
//
// region1 vmselect:
// -clusternativeListenAddr=:8401 -acceptFilters=region=eu-1
// region2 vmselect:
// -clusternativeListenAddr=:8401 -acceptFilters=region=eu-2
// region3 vmselect:
// -clusternativeListenAddr=:8401 -acceptFilters=region=us-.*

// top-level vmselect
-storageNode=http://vmselect-region1/
-storageNode=http://vmselect-region2/
-storageNode=http://vmselect-region3/
...

With the configuration above, a query containing the region label could be filtered immediately once it reaches the corresponding region vmselect. Any region vmselect whose acceptFilters doesn't match the query's label filter would short-circuit and return an empty result immediately. Also, queries missing the specified acceptFilters label should still be executed to allow unscoped queries.

Describe alternatives you've considered

Set up query entrances for region vmselect, global vmselect, or other region vmselect groups as needed, so different queries that require different scopes can use the most efficient entrance.

Additional information

No response

Source: VictoriaMetrics/VictoriaMetrics