From 943464646a3f06e20f897c75286ebc7b3645300a Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Wed, 30 Jun 2021 11:09:48 +0300 Subject: [PATCH] Remove OpenTelemetry metrics for now --- internal/instruments.go | 33 --------------------------------- internal/pool/conn.go | 3 --- internal/pool/pool.go | 1 - 3 files changed, 37 deletions(-) delete mode 100644 internal/instruments.go diff --git a/internal/instruments.go b/internal/instruments.go deleted file mode 100644 index 49d6111e18..0000000000 --- a/internal/instruments.go +++ /dev/null @@ -1,33 +0,0 @@ -package internal - -import ( - "context" - - "go.opentelemetry.io/otel/metric" - "go.opentelemetry.io/otel/metric/global" -) - -var ( - // WritesCounter is a count of write commands performed. - WritesCounter metric.Int64Counter - // NewConnectionsCounter is a count of new connections. - NewConnectionsCounter metric.Int64Counter -) - -func init() { - defer func() { - if r := recover(); r != nil { - Logger.Printf(context.Background(), "Error creating meter github.com/go-redis/redis for Instruments", r) - } - }() - - meter := metric.Must(global.Meter("github.com/go-redis/redis")) - - WritesCounter = meter.NewInt64Counter("redis.writes", - metric.WithDescription("the number of writes initiated"), - ) - - NewConnectionsCounter = meter.NewInt64Counter("redis.new_connections", - metric.WithDescription("the number of connections created"), - ) -} diff --git a/internal/pool/conn.go b/internal/pool/conn.go index 1ce29edd4b..e81e52f3a5 100644 --- a/internal/pool/conn.go +++ b/internal/pool/conn.go @@ -7,7 +7,6 @@ import ( "sync/atomic" "time" - "github.com/go-redis/redis/v8/internal" "github.com/go-redis/redis/v8/internal/proto" ) @@ -90,8 +89,6 @@ func (cn *Conn) WithWriter( return err } - internal.WritesCounter.Add(ctx, 1) - return nil } diff --git a/internal/pool/pool.go b/internal/pool/pool.go index 4d247b3010..a8f0a6d4e2 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -188,7 +188,6 @@ func (p *ConnPool) dialConn(ctx context.Context, pooled bool) (*Conn, error) { return nil, err } - internal.NewConnectionsCounter.Add(ctx, 1) cn := NewConn(netConn) cn.pooled = pooled return cn, nil