storage/postgres: pgx client tracing (#5438)

* fix testcontainers docker client using the global tracer provider

* storage/postgres: pgx client tracing

* skip postgres test on macos
This commit is contained in:
Joe Kralicky 2025-01-28 17:10:09 -05:00 committed by GitHub
parent 332d3dc334
commit b5f58997bd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 100 additions and 12 deletions

View file

@ -2,6 +2,8 @@ package postgres
import (
"time"
oteltrace "go.opentelemetry.io/otel/trace"
)
const (
@ -10,8 +12,9 @@ const (
)
type config struct {
expiry time.Duration
registryTTL time.Duration
expiry time.Duration
registryTTL time.Duration
tracerProvider oteltrace.TracerProvider
}
// Option customizes a Backend.
@ -31,6 +34,12 @@ func WithRegistryTTL(ttl time.Duration) Option {
}
}
func WithTracerProvider(tracerProvider oteltrace.TracerProvider) Option {
return func(cfg *config) {
cfg.tracerProvider = tracerProvider
}
}
func getConfig(options ...Option) *config {
cfg := new(config)
WithExpiry(defaultExpiry)(cfg)