From 3e682ff2f954fbe243d38b114a3d78c572505cbd Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 12 May 2023 22:20:24 +0000 Subject: [PATCH] Bump go.opentelemetry.io/otel/metric from 0.37.0 to 0.38.1 (#18) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Jan Steinke --- go.mod | 2 +- go.sum | 4 ++-- instrumentation.go | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 6b0ec62..338d25c 100644 --- a/go.mod +++ b/go.mod @@ -5,7 +5,7 @@ go 1.20 require ( github.com/aws/aws-lambda-go v1.41.0 go.opentelemetry.io/otel v1.15.1 - go.opentelemetry.io/otel/metric v0.37.0 + go.opentelemetry.io/otel/metric v0.38.1 go.opentelemetry.io/otel/sdk v1.15.1 go.opentelemetry.io/otel/trace v1.15.1 ) diff --git a/go.sum b/go.sum index 01bf78c..1084395 100644 --- a/go.sum +++ b/go.sum @@ -20,8 +20,8 @@ github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= go.opentelemetry.io/otel v1.15.1 h1:3Iwq3lfRByPaws0f6bU3naAqOR1n5IeDWd9390kWHa8= go.opentelemetry.io/otel v1.15.1/go.mod h1:mHHGEHVDLal6YrKMmk9LqC4a3sF5g+fHfrttQIB1NTc= -go.opentelemetry.io/otel/metric v0.37.0 h1:pHDQuLQOZwYD+Km0eb657A25NaRzy0a+eLyKfDXedEs= -go.opentelemetry.io/otel/metric v0.37.0/go.mod h1:DmdaHfGt54iV6UKxsV9slj2bBRJcKC1B1uvDLIioc1s= +go.opentelemetry.io/otel/metric v0.38.1 h1:2MM7m6wPw9B8Qv8iHygoAgkbejed59uUR6ezR5T3X2s= +go.opentelemetry.io/otel/metric v0.38.1/go.mod h1:FwqNHD3I/5iX9pfrRGZIlYICrJv0rHEUl2Ln5vdIVnQ= go.opentelemetry.io/otel/sdk v1.15.1 h1:5FKR+skgpzvhPQHIEfcwMYjCBr14LWzs3uSqKiQzETI= go.opentelemetry.io/otel/sdk v1.15.1/go.mod h1:8rVtxQfrbmbHKfqzpQkT5EzZMcbMBwTzNAggbEAM0KA= go.opentelemetry.io/otel/trace v1.15.1 h1:uXLo6iHJEzDfrNC0L0mNjItIp06SyaBQxu5t3xMlngY= diff --git a/instrumentation.go b/instrumentation.go index 5cf51f5..101be27 100644 --- a/instrumentation.go +++ b/instrumentation.go @@ -77,15 +77,15 @@ func EndpointMetrics[TIn, TOut any](mp metric.MeterProvider) Middleware[TIn, TOu return func(ctx context.Context, req TIn) (TOut, error) { start := time.Now() if counter, Merr := meter.Int64Counter("requests"); Merr == nil { - counter.Add(ctx, 1, attrs) + counter.Add(ctx, 1, metric.WithAttributes(attrs)) } if hist, Merr := meter.Float64Histogram("latency"); Merr == nil { - defer hist.Record(ctx, time.Since(start).Seconds(), attrs) + defer hist.Record(ctx, time.Since(start).Seconds(), metric.WithAttributes(attrs)) } resp, err := next(ctx, req) if err != nil { if counter, Merr := meter.Int64Counter("errors"); Merr == nil { - counter.Add(ctx, 1, attrs) + counter.Add(ctx, 1, metric.WithAttributes(attrs)) } } return resp, err