Merge pull request #11635 from bboreham/note-hash

labels: note that Hash may change
This commit is contained in:
Julien Pivotto 2022-12-08 11:16:48 +01:00 committed by GitHub
commit 7189f919dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 0 deletions

View File

@ -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)