Skip to content

Commit

Permalink
Bump go.opentelemetry.io/otel/metric from 0.37.0 to 0.38.1 (#18)
Browse files Browse the repository at this point in the history
Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jan Steinke <[email protected]>
  • Loading branch information
dependabot[bot] and Jan Steinke authored May 12, 2023
1 parent d7867f3 commit 3e682ff
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -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=
Expand Down
6 changes: 3 additions & 3 deletions instrumentation.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3e682ff

Please sign in to comment.