From 49292857b784d2cc510261f9abb48d288593243a Mon Sep 17 00:00:00 2001 From: Preeti Dewani Date: Wed, 19 Nov 2025 15:36:20 +0530 Subject: [PATCH] Replace fnv with xxhash (#7497) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit **Objective**: - Performance comparison between fnv and xxhash in terms of ops/sec, allocations and collisions - Implement xxhash according to first objective **Changes**: - fnv is replaced by xxhash. Perform stats: - **Collision**: No collision upto 100M - **Allocations**: Same in both cases - **Ops/sec**: xxhash performed better in cases with medium to large strings **Benchmarks**: ``` benchstat old.txt new.txt goos: darwin goarch: arm64 pkg: go.opentelemetry.io/otel/attribute cpu: Apple M2 │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ NewSet-8 205.5n ± 1% 229.4n ± 1% +11.61% (p=0.002 n=6) NewSetSmallStrings-8 160.5n ± 1% 169.0n ± 5% +5.26% (p=0.002 n=6) NewSetMediumStrings-8 263.8n ± 6% 185.0n ± 1% -29.89% (p=0.002 n=6) NewSetLargeStrings-8 426.4n ± 9% 210.2n ± 1% -50.72% (p=0.002 n=6) NewSetVeryLargeStrings-8 1012.5n ± 7% 238.7n ± 2% -76.43% (p=0.002 n=6) NewSetHugeStrings-8 3622.0n ± 8% 397.1n ± 1% -89.04% (p=0.002 n=6) geomean 488.6n 228.6n -53.21% │ old.txt │ new.txt │ │ B/op │ B/op vs base │ NewSet-8 448.0 ± 0% 448.0 ± 0% ~ (p=1.000 n=6) ¹ NewSetSmallStrings-8 320.0 ± 0% 320.0 ± 0% ~ (p=1.000 n=6) ¹ NewSetMediumStrings-8 320.0 ± 0% 320.0 ± 0% ~ (p=1.000 n=6) ¹ NewSetLargeStrings-8 320.0 ± 0% 320.0 ± 0% ~ (p=1.000 n=6) ¹ NewSetVeryLargeStrings-8 320.0 ± 0% 320.0 ± 0% ~ (p=1.000 n=6) ¹ NewSetHugeStrings-8 320.0 ± 0% 320.0 ± 0% ~ (p=1.000 n=6) ¹ geomean 338.5 338.5 +0.00% ¹ all samples are equal │ old.txt │ new.txt │ │ allocs/op │ allocs/op vs base │ NewSet-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ NewSetSmallStrings-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ NewSetMediumStrings-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ NewSetLargeStrings-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ NewSetVeryLargeStrings-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ NewSetHugeStrings-8 1.000 ± 0% 1.000 ± 0% ~ (p=1.000 n=6) ¹ geomean 1.000 1.000 +0.00% ¹ all samples are equal ``` Previous implementation for reference: https://github.com/open-telemetry/opentelemetry-go/blame/d0483a7c89d936dcced557fb523465daeac16967/CHANGELOG.md#L16 --------- Co-authored-by: Robert Pająk --- CHANGELOG.md | 1 + attribute/hash.go | 16 +- attribute/hash_test.go | 6 +- attribute/internal/fnv/fnv.go | 76 ------- attribute/internal/fnv/fnv_test.go | 98 --------- attribute/internal/xxhash/xxhash.go | 64 ++++++ attribute/internal/xxhash/xxhash_test.go | 197 ++++++++++++++++++ attribute/set.go | 13 +- attribute/set_test.go | 58 +++++- bridge/opencensus/go.mod | 1 + bridge/opencensus/go.sum | 2 + bridge/opencensus/test/go.mod | 1 + bridge/opencensus/test/go.sum | 2 + bridge/opentracing/go.mod | 1 + bridge/opentracing/go.sum | 2 + exporters/otlp/otlplog/otlploggrpc/go.mod | 1 + exporters/otlp/otlplog/otlploggrpc/go.sum | 2 + exporters/otlp/otlplog/otlploghttp/go.mod | 1 + exporters/otlp/otlplog/otlploghttp/go.sum | 2 + .../otlp/otlpmetric/otlpmetricgrpc/go.mod | 1 + .../otlp/otlpmetric/otlpmetricgrpc/go.sum | 2 + .../otlp/otlpmetric/otlpmetrichttp/go.mod | 1 + .../otlp/otlpmetric/otlpmetrichttp/go.sum | 2 + exporters/otlp/otlptrace/go.mod | 1 + exporters/otlp/otlptrace/go.sum | 2 + exporters/otlp/otlptrace/otlptracegrpc/go.mod | 1 + exporters/otlp/otlptrace/otlptracegrpc/go.sum | 2 + exporters/otlp/otlptrace/otlptracehttp/go.mod | 1 + exporters/otlp/otlptrace/otlptracehttp/go.sum | 2 + exporters/stdout/stdoutlog/go.mod | 1 + exporters/stdout/stdoutlog/go.sum | 2 + exporters/stdout/stdoutmetric/go.mod | 1 + exporters/stdout/stdoutmetric/go.sum | 2 + exporters/stdout/stdouttrace/go.mod | 1 + exporters/stdout/stdouttrace/go.sum | 2 + exporters/zipkin/go.mod | 1 + exporters/zipkin/go.sum | 2 + go.mod | 1 + go.sum | 2 + log/go.mod | 1 + log/go.sum | 2 + log/logtest/go.mod | 1 + log/logtest/go.sum | 2 + metric/go.mod | 1 + metric/go.sum | 2 + sdk/go.mod | 1 + sdk/go.sum | 2 + sdk/log/go.mod | 1 + sdk/log/go.sum | 2 + sdk/log/logtest/go.mod | 1 + sdk/log/logtest/go.sum | 2 + sdk/metric/go.mod | 1 + sdk/metric/go.sum | 2 + trace/go.mod | 1 + trace/go.sum | 2 + 55 files changed, 403 insertions(+), 195 deletions(-) delete mode 100644 attribute/internal/fnv/fnv.go delete mode 100644 attribute/internal/fnv/fnv_test.go create mode 100644 attribute/internal/xxhash/xxhash.go create mode 100644 attribute/internal/xxhash/xxhash_test.go diff --git a/CHANGELOG.md b/CHANGELOG.md index d0393e1a4..721517ed5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -57,6 +57,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm - The `ErrorType` function in `go.opentelemetry.io/otel/semconv/v1.37.0` now handles custom error types. If an error implements an `ErrorType() string` method, the return value of that method will be used as the error type. (#7442) - Improve performance of concurrent measurements in `go.opentelemetry.io/otel/sdk/metric`. (#7427) +- Replace fnv hash with xxhash in `go.opentelemetry.io/otel/attribute` for better performance. (#7371) diff --git a/attribute/hash.go b/attribute/hash.go index 742cb2832..6aa69aeae 100644 --- a/attribute/hash.go +++ b/attribute/hash.go @@ -7,7 +7,7 @@ import ( "fmt" "reflect" - "go.opentelemetry.io/otel/attribute/internal/fnv" + "go.opentelemetry.io/otel/attribute/internal/xxhash" ) // Type identifiers. These identifiers are hashed before the value of the @@ -17,7 +17,7 @@ import ( // // These are all 8 byte length strings converted to a uint64 representation. A // uint64 is used instead of the string directly as an optimization, it avoids -// the for loop in [fnv] which adds minor overhead. +// the for loop in [xxhash] which adds minor overhead. const ( boolID uint64 = 7953749933313450591 // "_boolean" (little endian) int64ID uint64 = 7592915492740740150 // "64_bit_i" (little endian) @@ -29,17 +29,17 @@ const ( stringSliceID uint64 = 7453010373645655387 // "[]string" (little endian) ) -// hashKVs returns a new FNV-1a hash of kvs. -func hashKVs(kvs []KeyValue) fnv.Hash { - h := fnv.New() +// hashKVs returns a new xxHash64 hash of kvs. +func hashKVs(kvs []KeyValue) uint64 { + h := xxhash.New() for _, kv := range kvs { h = hashKV(h, kv) } - return h + return h.Sum64() } -// hashKV returns the FNV-1a hash of kv with h as the base. -func hashKV(h fnv.Hash, kv KeyValue) fnv.Hash { +// hashKV returns the xxHash64 hash of kv with h as the base. +func hashKV(h xxhash.Hash, kv KeyValue) xxhash.Hash { h = h.String(string(kv.Key)) switch kv.Value.Type() { diff --git a/attribute/hash_test.go b/attribute/hash_test.go index d49cdf636..0d98c8fb1 100644 --- a/attribute/hash_test.go +++ b/attribute/hash_test.go @@ -11,8 +11,6 @@ import ( "slices" "strings" "testing" - - "go.opentelemetry.io/otel/attribute/internal/fnv" ) // keyVals is all the KeyValue generators that are used for testing. This is @@ -42,7 +40,7 @@ var keyVals = []func(string) KeyValue{ func TestHashKVsEquality(t *testing.T) { type testcase struct { - hash fnv.Hash + hash uint64 kvs []KeyValue } @@ -105,7 +103,7 @@ func TestHashKVsEquality(t *testing.T) { type msg struct { cmp string i, j int - hI, hJ fnv.Hash + hI, hJ uint64 kvI, kvJ []KeyValue } diff --git a/attribute/internal/fnv/fnv.go b/attribute/internal/fnv/fnv.go deleted file mode 100644 index 449b7d853..000000000 --- a/attribute/internal/fnv/fnv.go +++ /dev/null @@ -1,76 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -// Package fnv provides an efficient and allocation free implementation of the -// FNV-1a, non-cryptographic hash functions created by Glenn Fowler, Landon -// Curt Noll, and Phong Vo. See -// https://en.wikipedia.org/wiki/Fowler-Noll-Vo_hash_function. -// -// This implementation is provided as an alternative to "hash/fnv". The -// built-in implementation requires two allocations per Write for a string (one -// for the hash pointer and the other to convert a string to a []byte). This -// implementation is more efficientient and does not require any allocations. -package fnv // import "go.opentelemetry.io/otel/attribute/internal/fnv" - -import ( - "math" -) - -// Taken from "hash/fnv". Verified at: -// -// - https://datatracker.ietf.org/doc/html/draft-eastlake-fnv-17.html -// - http://www.isthe.com/chongo/tech/comp/fnv/index.html#FNV-param -const ( - offset64 = 14695981039346656037 - prime64 = 1099511628211 -) - -// Hash is an FNV-1a hash with appropriate hashing functions for methods. -type Hash uint64 - -// New returns a new initialized 64-bit FNV-1a Hash. Its value is laid out in -// big-endian byte order. -func New() Hash { - return offset64 -} - -func (h Hash) Uint64(val uint64) Hash { - v := uint64(h) - v = (v ^ ((val >> 56) & 0xFF)) * prime64 - v = (v ^ ((val >> 48) & 0xFF)) * prime64 - v = (v ^ ((val >> 40) & 0xFF)) * prime64 - v = (v ^ ((val >> 32) & 0xFF)) * prime64 - v = (v ^ ((val >> 24) & 0xFF)) * prime64 - v = (v ^ ((val >> 16) & 0xFF)) * prime64 - v = (v ^ ((val >> 8) & 0xFF)) * prime64 - v = (v ^ ((val >> 0) & 0xFF)) * prime64 - return Hash(v) -} - -func (h Hash) Bool(val bool) Hash { // nolint:revive // val is not a flag. - if val { - return h.Uint64(1) - } - return h.Uint64(0) -} - -func (h Hash) Float64(val float64) Hash { - return h.Uint64(math.Float64bits(val)) -} - -func (h Hash) Int64(val int64) Hash { - return h.Uint64(uint64(val)) // nolint:gosec // overflow doesn't matter since we are hashing. -} - -func (h Hash) String(val string) Hash { - v := uint64(h) - for i := 0; i < len(val); i++ { - v ^= uint64(val[i]) - v *= prime64 - } - return Hash(v) -} diff --git a/attribute/internal/fnv/fnv_test.go b/attribute/internal/fnv/fnv_test.go deleted file mode 100644 index 7525c997b..000000000 --- a/attribute/internal/fnv/fnv_test.go +++ /dev/null @@ -1,98 +0,0 @@ -// Copyright The OpenTelemetry Authors -// SPDX-License-Identifier: Apache-2.0 - -// Copyright 2011 The Go Authors. All rights reserved. -// Use of this source code is governed by a BSD-style -// license that can be found in the LICENSE file. - -package fnv - -import ( - "encoding/binary" - "hash/fnv" - "testing" - - "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" -) - -func TestStringHashCorrectness(t *testing.T) { - input := []string{"", "a", "ab", "abc", "世界"} - - refH := fnv.New64a() - for _, in := range input { - h := New() - got := h.String(in) - - refH.Reset() - n, err := refH.Write([]byte(in)) - require.NoError(t, err) - require.Equalf(t, len(in), n, "wrote only %d out of %d bytes", n, len(in)) - want := refH.Sum64() - - assert.Equal(t, want, uint64(got), in) - } -} - -func TestUint64HashCorrectness(t *testing.T) { - input := []uint64{0, 10, 312984238623, 1024} - - buf := make([]byte, 8) - refH := fnv.New64a() - for _, in := range input { - h := New() - got := h.Uint64(in) - - refH.Reset() - binary.BigEndian.PutUint64(buf, in) - n, err := refH.Write(buf) - require.NoError(t, err) - require.Equalf(t, 8, n, "wrote only %d out of 8 bytes", n) - want := refH.Sum64() - - assert.Equal(t, want, uint64(got), in) - } -} - -func TestIntegrity(t *testing.T) { - data := []byte{'1', '2', 3, 4, 5, 6, 7, 8, 9, 10} - h0 := New() - want := h0.String(string(data)) - - h1 := New() - got := h1.String(string(data[:2])) - num := binary.BigEndian.Uint64(data[2:]) - got = got.Uint64(num) - - assert.Equal(t, want, got) -} - -var result Hash - -func BenchmarkStringKB(b *testing.B) { - b.SetBytes(1024) - data := make([]byte, 1024) - for i := range data { - data[i] = byte(i) - } - s := string(data) - h := New() - - b.ReportAllocs() - b.ResetTimer() - for range b.N { - result = h.String(s) - } -} - -func BenchmarkUint64KB(b *testing.B) { - b.SetBytes(8) - i := uint64(192386739218721) - h := New() - - b.ReportAllocs() - b.ResetTimer() - for range b.N { - result = h.Uint64(i) - } -} diff --git a/attribute/internal/xxhash/xxhash.go b/attribute/internal/xxhash/xxhash.go new file mode 100644 index 000000000..113a97838 --- /dev/null +++ b/attribute/internal/xxhash/xxhash.go @@ -0,0 +1,64 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +// Package xxhash provides a wrapper around the xxhash library for attribute hashing. +package xxhash // import "go.opentelemetry.io/otel/attribute/internal/xxhash" + +import ( + "encoding/binary" + "math" + + "github.com/cespare/xxhash/v2" +) + +// Hash wraps xxhash.Digest to provide an API friendly for hashing attribute values. +type Hash struct { + d *xxhash.Digest +} + +// New returns a new initialized xxHash64 hasher. +func New() Hash { + return Hash{d: xxhash.New()} +} + +func (h Hash) Uint64(val uint64) Hash { + var buf [8]byte + binary.LittleEndian.PutUint64(buf[:], val) + // errors from Write are always nil for xxhash + // if it returns an err then panic + _, err := h.d.Write(buf[:]) + if err != nil { + panic("xxhash write of uint64 failed: " + err.Error()) + } + return h +} + +func (h Hash) Bool(val bool) Hash { // nolint:revive // This is a hashing function. + if val { + return h.Uint64(1) + } + return h.Uint64(0) +} + +func (h Hash) Float64(val float64) Hash { + return h.Uint64(math.Float64bits(val)) +} + +func (h Hash) Int64(val int64) Hash { + return h.Uint64(uint64(val)) // nolint:gosec // Overflow doesn't matter since we are hashing. +} + +func (h Hash) String(val string) Hash { + // errors from WriteString are always nil for xxhash + // if it returns an err then panic + _, err := h.d.WriteString(val) + if err != nil { + panic("xxhash write of string failed: " + err.Error()) + } + return h +} + +// Sum64 returns the current hash value. +func (h Hash) Sum64() uint64 { + return h.d.Sum64() +} diff --git a/attribute/internal/xxhash/xxhash_test.go b/attribute/internal/xxhash/xxhash_test.go new file mode 100644 index 000000000..a8f19fed0 --- /dev/null +++ b/attribute/internal/xxhash/xxhash_test.go @@ -0,0 +1,197 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package xxhash + +import ( + "encoding/binary" + "testing" + + "github.com/stretchr/testify/assert" +) + +func TestIntegrity(t *testing.T) { + data := []byte{'1', '2', 3, 4, 5, 6, 7, 8, 9, 10} + h0 := New() + want := h0.String(string(data)) + + h1 := New() + got := h1.String(string(data[:2])) + num := binary.LittleEndian.Uint64(data[2:]) + got = got.Uint64(num) + + assert.Equal(t, want.Sum64(), got.Sum64()) +} + +func TestNew(t *testing.T) { + h1 := New() + h2 := New() + + // Test that the underlying digest is properly initialized. + if h1.Sum64() != h2.Sum64() { + t.Errorf("New() should return consistent initial value: %d != %d", h1.Sum64(), h2.Sum64()) + } +} + +func TestUint64(t *testing.T) { + h1 := New().Uint64(42) + h2 := New().Uint64(42) + if h1.Sum64() != h2.Sum64() { + t.Errorf("Uint64() should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + h3 := New().Uint64(43) + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different inputs should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func TestBool(t *testing.T) { + h1 := New().Bool(true) + h2 := New().Bool(true) + if h1.Sum64() != h2.Sum64() { + t.Errorf("Bool() should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + h3 := New().Bool(false) + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different bool values should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func TestFloat64(t *testing.T) { + h1 := New().Float64(3.14) + h2 := New().Float64(3.14) + if h1.Sum64() != h2.Sum64() { + t.Errorf("Float64() should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + h3 := New().Float64(2.71) + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different float values should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func TestInt64(t *testing.T) { + h1 := New().Int64(42) + h2 := New().Int64(42) + if h1.Sum64() != h2.Sum64() { + t.Errorf("Int64() should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + h3 := New().Int64(43) + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different int64 values should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func TestString(t *testing.T) { + h1 := New().String("hello") + h2 := New().String("hello") + if h1.Sum64() != h2.Sum64() { + t.Errorf("String() should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + h3 := New().String("world") + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different strings should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func TestChaining(t *testing.T) { + // Test that methods can be chained and produce different results + h1 := New().String("key").Uint64(42).Bool(true) + h2 := New().String("key").Uint64(42).Bool(true) + h3 := New().String("key").Uint64(43).Bool(true) + + if h1.Sum64() != h2.Sum64() { + t.Errorf("Chained operations should be deterministic: %d != %d", h1.Sum64(), h2.Sum64()) + } + + if h1.Sum64() == h3.Sum64() { + t.Errorf("Different chained operations should produce different hashes: %d == %d", h1.Sum64(), h3.Sum64()) + } +} + +func BenchmarkStringKB(b *testing.B) { + b.SetBytes(1024) + data := make([]byte, 1024) + for i := range data { + data[i] = byte(i) + } + s := string(data) + h := New() + + b.ReportAllocs() + b.ResetTimer() + for b.Loop() { + h.String(s) + } +} + +func BenchmarkUint64KB(b *testing.B) { + b.SetBytes(8) + i := uint64(192386739218721) + h := New() + + b.ReportAllocs() + b.ResetTimer() + for b.Loop() { + h.Uint64(i) + } +} + +func BenchmarkUint64(b *testing.B) { + h := New() + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + h = h.Uint64(uint64(i)) + } +} + +func BenchmarkString(b *testing.B) { + h := New() + str := "benchmark_string_value" + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + h = h.String(str) + } +} + +func BenchmarkBool(b *testing.B) { + h := New() + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + h = h.Bool(i%2 == 0) + } +} + +func BenchmarkFloat64(b *testing.B) { + h := New() + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + h = h.Float64(float64(i) * 3.14159) + } +} + +func BenchmarkInt64(b *testing.B) { + h := New() + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + h = h.Int64(int64(i)) + } +} + +func BenchmarkSum64(b *testing.B) { + h := New().String("key").Uint64(42).Bool(true) + b.ResetTimer() + b.ReportAllocs() + for i := 0; i < b.N; i++ { + _ = h.Sum64() + } +} diff --git a/attribute/set.go b/attribute/set.go index 177cf2ee0..911d557ee 100644 --- a/attribute/set.go +++ b/attribute/set.go @@ -10,7 +10,7 @@ import ( "slices" "sort" - "go.opentelemetry.io/otel/attribute/internal/fnv" + "go.opentelemetry.io/otel/attribute/internal/xxhash" ) type ( @@ -28,7 +28,7 @@ type ( // instead of a Set directly. Set has relatively poor performance when used // as a map key compared to Distinct. Set struct { - hash fnv.Hash + hash uint64 data any } @@ -37,7 +37,7 @@ type ( // Distinct should be used as a map key instead of a Set for to provide better // performance for map operations. Distinct struct { - hash fnv.Hash + hash uint64 } // Sortable implements sort.Interface, used for sorting KeyValue. @@ -60,18 +60,21 @@ var ( // keyValueType is used in computeDistinctReflect. keyValueType = reflect.TypeOf(KeyValue{}) + // emptyHash is the hash of an empty set. + emptyHash = xxhash.New().Sum64() + // userDefinedEmptySet is an empty set. It was mistakenly exposed to users // as something they can assign to, so it must remain addressable and // mutable. // // This is kept for backwards compatibility, but should not be used in new code. userDefinedEmptySet = &Set{ - hash: fnv.New(), + hash: emptyHash, data: [0]KeyValue{}, } emptySet = Set{ - hash: fnv.New(), + hash: emptyHash, data: [0]KeyValue{}, } ) diff --git a/attribute/set_test.go b/attribute/set_test.go index b86786784..098458310 100644 --- a/attribute/set_test.go +++ b/attribute/set_test.go @@ -528,8 +528,6 @@ func BenchmarkFiltering(b *testing.B) { b.Run("AllDropped", benchFn(func(attribute.KeyValue) bool { return false })) } -var sinkSet attribute.Set - func BenchmarkNewSet(b *testing.B) { attrs := []attribute.KeyValue{ attribute.String("B1", "2"), @@ -542,7 +540,59 @@ func BenchmarkNewSet(b *testing.B) { } b.ReportAllocs() b.ResetTimer() - for i := 0; i < b.N; i++ { - sinkSet = attribute.NewSet(attrs...) + for b.Loop() { + attribute.NewSet(attrs...) + } +} + +// generateStringAttrsWithSize creates 5 string attributes with specified key and value lengths. +func generateStringAttrsWithSize(keyLen, valueLen int) []attribute.KeyValue { + // Generate base strings of specified lengths + keyBase := "" + valueBase := "" + + // Build key base string + for i := 0; i < keyLen; i++ { + keyBase += string(rune('a' + i%26)) + } + + // Build value base string + for i := 0; i < valueLen; i++ { + valueBase += string(rune('0' + i%10)) + } + + // Create 5 attributes with different suffixes to ensure uniqueness + attrs := []attribute.KeyValue{ + attribute.String(keyBase+"1", valueBase+"x"), + attribute.String(keyBase+"2", valueBase+"y"), + attribute.String(keyBase+"3", valueBase+"z"), + attribute.String(keyBase+"4", valueBase+"w"), + attribute.String(keyBase+"5", valueBase+"v"), + } + return attrs +} + +func BenchmarkNewSetStringAttrs(b *testing.B) { + testCases := []struct { + name string + keyLen int + valueLen int + }{ + {"SmallStrings", 2, 1}, // B1="2" + {"MediumStrings", 10, 10}, // realistic service names, etc. + {"LargeStrings", 25, 25}, // longer service names, URLs, etc. + {"VeryLargeStrings", 50, 100}, // very long values like URLs, descriptions + {"HugeStrings", 100, 500}, // extremely large like full URLs, JSON, etc. + } + + for _, tc := range testCases { + b.Run(tc.name, func(b *testing.B) { + attrs := generateStringAttrsWithSize(tc.keyLen, tc.valueLen) + b.ReportAllocs() + b.ResetTimer() + for b.Loop() { + attribute.NewSet(attrs...) + } + }) } } diff --git a/bridge/opencensus/go.mod b/bridge/opencensus/go.mod index 95963e1b3..46d934e84 100644 --- a/bridge/opencensus/go.mod +++ b/bridge/opencensus/go.mod @@ -12,6 +12,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/bridge/opencensus/go.sum b/bridge/opencensus/go.sum index 27ddcee16..28e3359e4 100644 --- a/bridge/opencensus/go.sum +++ b/bridge/opencensus/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/bridge/opencensus/test/go.mod b/bridge/opencensus/test/go.mod index a5a2245ee..d396ffa85 100644 --- a/bridge/opencensus/test/go.mod +++ b/bridge/opencensus/test/go.mod @@ -11,6 +11,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/golang/groupcache v0.0.0-20241129210726-2c02b8208cf8 // indirect diff --git a/bridge/opencensus/test/go.sum b/bridge/opencensus/test/go.sum index 3bdec0f0d..d6fdeaabf 100644 --- a/bridge/opencensus/test/go.sum +++ b/bridge/opencensus/test/go.sum @@ -1,6 +1,8 @@ cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw= github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw= github.com/cncf/udpa/go v0.0.0-20191209042840-269d4d468f6f/go.mod h1:M8M6+tZqaGXZJjfX53e64911xZQV5JYwmTeXPW+k8Sc= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/bridge/opentracing/go.mod b/bridge/opentracing/go.mod index 80a1ca191..6fd264a7b 100644 --- a/bridge/opentracing/go.mod +++ b/bridge/opentracing/go.mod @@ -17,6 +17,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/bridge/opentracing/go.sum b/bridge/opentracing/go.sum index 4a278e080..9c13db58f 100644 --- a/bridge/opentracing/go.sum +++ b/bridge/opentracing/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/exporters/otlp/otlplog/otlploggrpc/go.mod b/exporters/otlp/otlplog/otlploggrpc/go.mod index acf4a4822..67e3912d9 100644 --- a/exporters/otlp/otlplog/otlploggrpc/go.mod +++ b/exporters/otlp/otlplog/otlploggrpc/go.mod @@ -24,6 +24,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/otlp/otlplog/otlploggrpc/go.sum b/exporters/otlp/otlplog/otlploggrpc/go.sum index 1741282fe..a4fa51d7b 100644 --- a/exporters/otlp/otlplog/otlploggrpc/go.sum +++ b/exporters/otlp/otlplog/otlploggrpc/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlplog/otlploghttp/go.mod b/exporters/otlp/otlplog/otlploghttp/go.mod index bb2fa4d61..a286d03f0 100644 --- a/exporters/otlp/otlplog/otlploghttp/go.mod +++ b/exporters/otlp/otlplog/otlploghttp/go.mod @@ -23,6 +23,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/exporters/otlp/otlplog/otlploghttp/go.sum b/exporters/otlp/otlplog/otlploghttp/go.sum index 1741282fe..a4fa51d7b 100644 --- a/exporters/otlp/otlplog/otlploghttp/go.sum +++ b/exporters/otlp/otlplog/otlploghttp/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod index 6f6f6925d..959d2c755 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.mod @@ -18,6 +18,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.sum b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.sum index 1741282fe..a4fa51d7b 100644 --- a/exporters/otlp/otlpmetric/otlpmetricgrpc/go.sum +++ b/exporters/otlp/otlpmetric/otlpmetricgrpc/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod index 6c70baa6e..4f9d3f388 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/go.mod @@ -17,6 +17,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/otlp/otlpmetric/otlpmetrichttp/go.sum b/exporters/otlp/otlpmetric/otlpmetrichttp/go.sum index 1741282fe..a4fa51d7b 100644 --- a/exporters/otlp/otlpmetric/otlpmetrichttp/go.sum +++ b/exporters/otlp/otlpmetric/otlpmetrichttp/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlptrace/go.mod b/exporters/otlp/otlptrace/go.mod index 501a41a04..f07c346a2 100644 --- a/exporters/otlp/otlptrace/go.mod +++ b/exporters/otlp/otlptrace/go.mod @@ -13,6 +13,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/otlp/otlptrace/go.sum b/exporters/otlp/otlptrace/go.sum index 12ca0acce..761dbb3d0 100644 --- a/exporters/otlp/otlptrace/go.sum +++ b/exporters/otlp/otlptrace/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlptrace/otlptracegrpc/go.mod b/exporters/otlp/otlptrace/otlptracegrpc/go.mod index c8e8f3e35..244ca507b 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/go.mod +++ b/exporters/otlp/otlptrace/otlptracegrpc/go.mod @@ -19,6 +19,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/otlp/otlptrace/otlptracegrpc/go.sum b/exporters/otlp/otlptrace/otlptracegrpc/go.sum index 55cf9cf78..8c97e8bd3 100644 --- a/exporters/otlp/otlptrace/otlptracegrpc/go.sum +++ b/exporters/otlp/otlptrace/otlptracegrpc/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/otlp/otlptrace/otlptracehttp/go.mod b/exporters/otlp/otlptrace/otlptracehttp/go.mod index ecf846213..9bb08546e 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/go.mod +++ b/exporters/otlp/otlptrace/otlptracehttp/go.mod @@ -18,6 +18,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/google/uuid v1.6.0 // indirect diff --git a/exporters/otlp/otlptrace/otlptracehttp/go.sum b/exporters/otlp/otlptrace/otlptracehttp/go.sum index 55cf9cf78..8c97e8bd3 100644 --- a/exporters/otlp/otlptrace/otlptracehttp/go.sum +++ b/exporters/otlp/otlptrace/otlptracehttp/go.sum @@ -1,5 +1,7 @@ github.com/cenkalti/backoff/v5 v5.0.3 h1:ZN+IMa753KfX5hd8vVaMixjnqRZ3y8CuJKRKj1xcsSM= github.com/cenkalti/backoff/v5 v5.0.3/go.mod h1:rkhZdG3JZukswDf7f0cwqPNk4K0sa+F97BxZthm/crw= +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/stdout/stdoutlog/go.mod b/exporters/stdout/stdoutlog/go.mod index 507cb6851..615c5af32 100644 --- a/exporters/stdout/stdoutlog/go.mod +++ b/exporters/stdout/stdoutlog/go.mod @@ -16,6 +16,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/stdout/stdoutlog/go.sum b/exporters/stdout/stdoutlog/go.sum index 01168a2cb..8ff5d17d0 100644 --- a/exporters/stdout/stdoutlog/go.sum +++ b/exporters/stdout/stdoutlog/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/stdout/stdoutmetric/go.mod b/exporters/stdout/stdoutmetric/go.mod index cff50cc4f..3efee148b 100644 --- a/exporters/stdout/stdoutmetric/go.mod +++ b/exporters/stdout/stdoutmetric/go.mod @@ -10,6 +10,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/stdout/stdoutmetric/go.sum b/exporters/stdout/stdoutmetric/go.sum index 01168a2cb..8ff5d17d0 100644 --- a/exporters/stdout/stdoutmetric/go.sum +++ b/exporters/stdout/stdoutmetric/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/stdout/stdouttrace/go.mod b/exporters/stdout/stdouttrace/go.mod index d4546c86d..260ec6975 100644 --- a/exporters/stdout/stdouttrace/go.mod +++ b/exporters/stdout/stdouttrace/go.mod @@ -17,6 +17,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/exporters/stdout/stdouttrace/go.sum b/exporters/stdout/stdouttrace/go.sum index b2cf918ac..b9ca80a17 100644 --- a/exporters/stdout/stdouttrace/go.sum +++ b/exporters/stdout/stdouttrace/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/exporters/zipkin/go.mod b/exporters/zipkin/go.mod index fdb0c732e..995127408 100644 --- a/exporters/zipkin/go.mod +++ b/exporters/zipkin/go.mod @@ -14,6 +14,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/exporters/zipkin/go.sum b/exporters/zipkin/go.sum index fa374cb24..bd556b442 100644 --- a/exporters/zipkin/go.sum +++ b/exporters/zipkin/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/go.mod b/go.mod index bd2f4714a..4692dd53a 100644 --- a/go.mod +++ b/go.mod @@ -3,6 +3,7 @@ module go.opentelemetry.io/otel go 1.24.0 require ( + github.com/cespare/xxhash/v2 v2.3.0 github.com/go-logr/logr v1.4.3 github.com/go-logr/stdr v1.2.2 github.com/google/go-cmp v0.7.0 diff --git a/go.sum b/go.sum index 263ae9349..115d2be7c 100644 --- a/go.sum +++ b/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= diff --git a/log/go.mod b/log/go.mod index 026f115d6..7f810b7df 100644 --- a/log/go.mod +++ b/log/go.mod @@ -9,6 +9,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/log/go.sum b/log/go.sum index 6294408cc..e1e69cdad 100644 --- a/log/go.sum +++ b/log/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/log/logtest/go.mod b/log/logtest/go.mod index 894bd3395..dfdc3cb2d 100644 --- a/log/logtest/go.mod +++ b/log/logtest/go.mod @@ -10,6 +10,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/log/logtest/go.sum b/log/logtest/go.sum index 6294408cc..e1e69cdad 100644 --- a/log/logtest/go.sum +++ b/log/logtest/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/metric/go.mod b/metric/go.mod index e01290440..08cd145ad 100644 --- a/metric/go.mod +++ b/metric/go.mod @@ -8,6 +8,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/metric/go.sum b/metric/go.sum index 6294408cc..e1e69cdad 100644 --- a/metric/go.sum +++ b/metric/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/sdk/go.mod b/sdk/go.mod index 9c45519cb..fb941e5f7 100644 --- a/sdk/go.mod +++ b/sdk/go.mod @@ -18,6 +18,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/stdr v1.2.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/sdk/go.sum b/sdk/go.sum index b2cf918ac..b9ca80a17 100644 --- a/sdk/go.sum +++ b/sdk/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/sdk/log/go.mod b/sdk/log/go.mod index 09ccb068d..39e01302b 100644 --- a/sdk/log/go.mod +++ b/sdk/log/go.mod @@ -16,6 +16,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/sdk/log/go.sum b/sdk/log/go.sum index 01168a2cb..8ff5d17d0 100644 --- a/sdk/log/go.sum +++ b/sdk/log/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/sdk/log/logtest/go.mod b/sdk/log/logtest/go.mod index 901b20efb..141540196 100644 --- a/sdk/log/logtest/go.mod +++ b/sdk/log/logtest/go.mod @@ -12,6 +12,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/go-logr/logr v1.4.3 // indirect github.com/go-logr/stdr v1.2.2 // indirect diff --git a/sdk/log/logtest/go.sum b/sdk/log/logtest/go.sum index 01168a2cb..8ff5d17d0 100644 --- a/sdk/log/logtest/go.sum +++ b/sdk/log/logtest/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/sdk/metric/go.mod b/sdk/metric/go.mod index 2e555bba8..e63ab373c 100644 --- a/sdk/metric/go.mod +++ b/sdk/metric/go.mod @@ -14,6 +14,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/google/uuid v1.6.0 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect diff --git a/sdk/metric/go.sum b/sdk/metric/go.sum index 01168a2cb..8ff5d17d0 100644 --- a/sdk/metric/go.sum +++ b/sdk/metric/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= diff --git a/trace/go.mod b/trace/go.mod index 151281a97..9af226edb 100644 --- a/trace/go.mod +++ b/trace/go.mod @@ -11,6 +11,7 @@ require ( ) require ( + github.com/cespare/xxhash/v2 v2.3.0 // indirect github.com/davecgh/go-spew v1.1.1 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/trace/go.sum b/trace/go.sum index e1f9146e4..105b62c58 100644 --- a/trace/go.sum +++ b/trace/go.sum @@ -1,3 +1,5 @@ +github.com/cespare/xxhash/v2 v2.3.0 h1:UL815xU9SqsFlibzuggzjXhog7bL6oX9BbNZnL2UFvs= +github.com/cespare/xxhash/v2 v2.3.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/google/go-cmp v0.7.0 h1:wk8382ETsv4JYUZwIsn6YpYiWiBsYLSJiTsyBybVuN8=