From 8d4140a06e44245b55bc01ccc14affc027162ad0 Mon Sep 17 00:00:00 2001 From: Bryan Boreham Date: Mon, 28 Nov 2022 16:16:55 +0000 Subject: [PATCH] labels: note that Hash may change For performance reasons we may use a different implementation of Hash() in future, so note this so callers can be warned. Signed-off-by: Bryan Boreham --- model/labels/labels.go | 1 + 1 file changed, 1 insertion(+) diff --git a/model/labels/labels.go b/model/labels/labels.go index 48237bdc0..d33fe0e29 100644 --- a/model/labels/labels.go +++ b/model/labels/labels.go @@ -134,6 +134,7 @@ func (ls Labels) MatchLabels(on bool, names ...string) Labels { } // Hash returns a hash value for the label set. +// Note: the result is not guaranteed to be consistent across different runs of Prometheus. func (ls Labels) Hash() uint64 { // Use xxhash.Sum64(b) for fast path as it's faster. b := make([]byte, 0, 1024)