1
0
mirror of https://github.com/redis/go-redis.git synced 2025-04-17 20:17:02 +03:00
go-redis/internal/instruments.go
Vladimir Mihailenco 38c87c1f84 Fix golangci
2020-07-16 10:01:27 +03:00

32 lines
793 B
Go

package internal
import (
"go.opentelemetry.io/otel/api/global"
"go.opentelemetry.io/otel/api/metric"
)
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("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"),
)
}