You've already forked opentelemetry-go
mirror of
https://github.com/open-telemetry/opentelemetry-go.git
synced 2026-06-03 18:35:08 +02:00
aa1894e09e
Updates the baggage implementation to comply with https://www.w3.org/TR/baggage/#limits: - Changed maxMembers from 180 to 64 (the W3C compliance requirement) > The resulting baggage-string contains 64 list-members or less. - Removed maxBytesPerMembers (4096) - this per-member limit was not part of the W3C spec - Added limit checking in extractMultiBaggage for multiple baggage headers: - Checks combined byte size across all headers (max 8192 bytes) - Checks combined member count across all headers (max 64 members) This uses non-deterministic truncation when handling baggage limits.
23 lines
534 B
Go
23 lines
534 B
Go
// Copyright The OpenTelemetry Authors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
package global
|
|
|
|
import (
|
|
"sync"
|
|
"testing"
|
|
)
|
|
|
|
// ResetForTest configures the test to restores the initial global state during
|
|
// its Cleanup step.
|
|
func ResetForTest(t testing.TB) {
|
|
t.Cleanup(func() {
|
|
globalTracer = defaultTracerValue()
|
|
globalPropagators = defaultPropagatorsValue()
|
|
globalMeterProvider = defaultMeterProvider()
|
|
delegateTraceOnce = sync.Once{}
|
|
delegateTextMapPropagatorOnce = sync.Once{}
|
|
delegateMeterOnce = sync.Once{}
|
|
})
|
|
}
|