Skip to content

Commit

Permalink
datastreams: Update mapping (#2703)
Browse files Browse the repository at this point in the history
Update mapping parameters for ddsketches to match the ones used by the Datadog backend.
This is going to avoid a conversion, which leads to precision loss & is pretty costly.
  • Loading branch information
piochelepiotr authored May 20, 2024
1 parent dfa02a3 commit a84d97a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/datastreams/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const (
defaultServiceName = "unnamed-go-service"
)

var sketchMapping, _ = mapping.NewLogarithmicMapping(0.01)
// use the same gamma and index offset as the Datadog backend, to avoid doing any conversions in
// the backend that would lead to a loss of precision
var sketchMapping, _ = mapping.NewLogarithmicMappingWithGamma(1.015625, 1.8761281912861705)

type statsPoint struct {
edgeTags []string
Expand Down

0 comments on commit a84d97a

Please sign in to comment.