mirror of
https://github.com/pomerium/pomerium.git
synced 2025-07-04 18:38:12 +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
|
@ -9,6 +9,7 @@ import (
|
|||
"time"
|
||||
|
||||
"github.com/cenkalti/backoff/v4"
|
||||
"github.com/exaring/otelpgx"
|
||||
"github.com/jackc/pgx/v5/pgxpool"
|
||||
"google.golang.org/protobuf/types/known/fieldmaskpb"
|
||||
"google.golang.org/protobuf/types/known/timestamppb"
|
||||
|
@ -353,6 +354,11 @@ func (backend *Backend) init(ctx context.Context) (serverVersion uint64, pool *p
|
|||
return serverVersion, nil, err
|
||||
}
|
||||
|
||||
if backend.cfg.tracerProvider != nil {
|
||||
config.ConnConfig.Tracer = otelpgx.NewTracer(
|
||||
otelpgx.WithTracerProvider(backend.cfg.tracerProvider))
|
||||
}
|
||||
|
||||
pool, err = pgxpool.NewWithConfig(context.Background(), config)
|
||||
if err != nil {
|
||||
return serverVersion, nil, err
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue