prometheus/model/labels
Marco Pracucci 501bc6419e
Add ShardedPostings() support to TSDB (#10421)
This PR is a reference implementation of the proposal described in #10420.

In addition to what described in #10420, in this PR I've introduced labels.StableHash(). The idea is to offer an hashing function which doesn't change over time, and that's used by query sharding in order to get a stable behaviour over time. The implementation of labels.StableHash() is the hashing function used by Prometheus before stringlabels, and what's used by Grafana Mimir for query sharding (because built before stringlabels was a thing).

Follow up work
As mentioned in #10420, if this PR is accepted I'm also open to upload another foundamental piece used by Grafana Mimir query sharding to accelerate the query execution: an optional, configurable and fast in-memory cache for the series hashes.

Signed-off-by: Marco Pracucci <marco@pracucci.com>
2024-01-29 11:57:27 +00:00
..
labels.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
labels_common.go labels: extract common code between slice and stringlabels 2023-11-17 18:20:03 +00:00
labels_stringlabels.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
labels_test.go Labels: Add DropMetricName function, used in PromQL (#13446) 2024-01-25 11:48:49 +01:00
matcher.go Move packages out of deprecated pkg directory 2021-11-09 08:03:10 +01:00
matcher_test.go feat: dont compile regex matcher if we know its a literal (#12434) 2023-06-07 21:54:30 +01:00
regexp.go feat: dont compile regex matcher if we know its a literal (#12434) 2023-06-07 21:54:30 +01:00
regexp_test.go Allow downstream projects to use faster regexp (#10251) 2022-02-08 11:03:20 +01:00
sharding.go Add ShardedPostings() support to TSDB (#10421) 2024-01-29 11:57:27 +00:00
sharding_stringlabels.go Add ShardedPostings() support to TSDB (#10421) 2024-01-29 11:57:27 +00:00
sharding_test.go Add ShardedPostings() support to TSDB (#10421) 2024-01-29 11:57:27 +00:00
test_utils.go labels: use ScratchBuilder in ReadLabels 2022-12-19 15:22:09 +00:00