move internal/telemetry/trace => pkg/telemetry/trace (#5541)

This commit is contained in:
Joe Kralicky 2025-03-25 10:43:04 -04:00 committed by GitHub
parent ab5f3ac7f3
commit a96ab2fe93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 40 additions and 40 deletions

View file

@ -0,0 +1,22 @@
package trace_test
import (
"context"
"testing"
"github.com/pomerium/pomerium/pkg/telemetry/trace"
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace/noop"
)
func TestUseGlobalPanicTracer(t *testing.T) {
t.Cleanup(func() {
otel.SetTracerProvider(noop.NewTracerProvider())
})
trace.UseGlobalPanicTracer()
tracer := otel.GetTracerProvider().Tracer("test")
assert.Panics(t, func() {
tracer.Start(context.Background(), "span")
})
}