mirror of
https://github.com/pomerium/pomerium.git
synced 2025-05-13 17:17:43 +02:00
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:
parent
332d3dc334
commit
b5f58997bd
6 changed files with 100 additions and 12 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue