feat(storage): lab6 add PostgreSQL, Redis and S3 tracing and DB pool metrics

This commit is contained in:
Голиков Maximillian Антон
2026-11-16 14:48:07 +03:00
parent c403b23595
commit 472b4761d6
11 changed files with 225 additions and 3 deletions
+3
View File
@@ -6,6 +6,8 @@ import (
"time"
"github.com/redis/go-redis/v9"
"high-loud-apps-labs/internal/telemetry"
)
func NewClient(url string) (*redis.Client, error) {
@@ -22,6 +24,7 @@ func NewClient(url string) (*redis.Client, error) {
opt.ConnMaxIdleTime = time.Minute
client := redis.NewClient(opt)
client.AddHook(tracingHook{tracer: telemetry.Tracer("storage.redis")})
ctx, cancel := context.WithTimeout(context.Background(), 3*time.Second)
defer cancel()