From 72a4588df5d91e529ec157647d0c1b1908178a13 Mon Sep 17 00:00:00 2001 From: Fuyang Liu Date: Thu, 26 Oct 2023 10:21:56 +0200 Subject: [PATCH] fix: minor fix for easier reading --- .../google.golang.org/grpc/otelgrpc/interceptor.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index 66a7306389d..d421e95945f 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -388,9 +388,8 @@ func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor { } elapsedTime := time.Since(before).Milliseconds() - attr = append(attr, semconv.RPCGRPCStatusCodeKey.Int64(int64(grpcStatusCode))) - o := metric.WithAttributes(attr...) - cfg.rpcServerDuration.Record(ctx, elapsedTime, o) + attr = append(attr, statusCodeAttr(grpcStatusCode)) + cfg.rpcServerDuration.Record(ctx, elapsedTime, metric.WithAttributes(attr...)) return resp, err }