Like Prometheus, but for logs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
loki/pkg/util/sample.go

13 lines
323 B

package util
import (
"github.com/cespare/xxhash/v2"
)
func UniqueSampleHash(lblString string, line []byte) uint64 {
uniqueID := make([]byte, 0, len(lblString)+len(line))
uniqueID = append(uniqueID, lblString...)
uniqueID = append(uniqueID, ':')
uniqueID = append(uniqueID, line...)
return xxhash.Sum64(uniqueID)
}