mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2026-07-23 01:01:19 +03:00
Previously, targets were sharded among `vmagent` instances by all target labels after relabeling. The commit adds `-promscrape.cluster.shardByLabels` optional flag to shard targets by specified labels. For example, with `-promscrape.cluster.shardByLabels=service`, the targets with the same `service` label value will be scraped by the same `vmagent` instance, which is useful when performing stream aggregation (drop pod label) that requires all metrics with the same `service` label value to be processed on the same `vmagent` instance. If none of the specified labels are present in the target labels, then all target labels will be used for sharding. Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/11044 PR https://github.com/VictoriaMetrics/VictoriaMetrics/pull/11114