forked from mtusi2026/mtusi2026lab6
feat(storage): lab6 add PostgreSQL, Redis and S3 tracing and DB pool metrics
This commit is contained in:
@@ -47,6 +47,12 @@ func Connect(ctx context.Context, cfg Config) (*pgxpool.Pool, error) {
|
||||
}
|
||||
poolCfg.HealthCheckPeriod = 10 * time.Second
|
||||
|
||||
tracer, err := newPoolTracer()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("метрики пула: %w", err)
|
||||
}
|
||||
poolCfg.ConnConfig.Tracer = tracer
|
||||
|
||||
pool, err := pgxpool.NewWithConfig(ctx, poolCfg)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("создание пула: %w", err)
|
||||
|
||||
Reference in New Issue
Block a user