fix(telemetry): lower bias in sample bucket calc

Signed-off-by: Babak K. Shandiz <babakks@github.com>
This commit is contained in:
Babak K. Shandiz 2026-04-21 17:49:28 +01:00
parent 571bb1c923
commit ec4a3ed6bd
No known key found for this signature in database
GPG key ID: 9472CAEFF56C742E

View file

@ -3,6 +3,7 @@ package telemetry
import (
"bytes"
"encoding/binary"
"encoding/json"
"errors"
"fmt"
@ -232,7 +233,7 @@ func NewService(flusher func(SendTelemetryPayload), opts ...telemetryServiceOpti
maps.Copy(commonDimensions, telemetryServiceOpts.additionalDimensions)
hash := uuid.NewSHA1(uuid.Nil, []byte(invocationID))
sampleBucket := hash[0] % 100
sampleBucket := byte(binary.BigEndian.Uint32(hash[:4]) % 100)
s := &service{
flush: flusher,