From 1f32092a3b04c21b6e8e51e2c94c03448d14a2c9 Mon Sep 17 00:00:00 2001 From: alijozi Date: Tue, 16 Feb 2021 11:38:55 +0100 Subject: [PATCH] Update OpenTelemetry to 0.17.0 and fix "undefined: otel.Meter" --- go.mod | 2 +- internal/instruments.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/go.mod b/go.mod index 4f595276..7f2e13e0 100644 --- a/go.mod +++ b/go.mod @@ -7,5 +7,5 @@ require ( github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f github.com/onsi/ginkgo v1.15.0 github.com/onsi/gomega v1.10.5 - go.opentelemetry.io/otel v0.16.0 + go.opentelemetry.io/otel v0.17.0 ) diff --git a/internal/instruments.go b/internal/instruments.go index 2d7dacce..49d6111e 100644 --- a/internal/instruments.go +++ b/internal/instruments.go @@ -3,8 +3,8 @@ package internal import ( "context" - "go.opentelemetry.io/otel" "go.opentelemetry.io/otel/metric" + "go.opentelemetry.io/otel/metric/global" ) var ( @@ -21,7 +21,7 @@ func init() { } }() - meter := metric.Must(otel.Meter("github.com/go-redis/redis")) + meter := metric.Must(global.Meter("github.com/go-redis/redis")) WritesCounter = meter.NewInt64Counter("redis.writes", metric.WithDescription("the number of writes initiated"),