From c992fdbe150cc51938d1e68f9d73f0bd643e9361 Mon Sep 17 00:00:00 2001 From: Ziqi Zhao Date: Fri, 10 Feb 2023 16:50:49 +0800 Subject: [PATCH] fix for comments Signed-off-by: Ziqi Zhao --- .../grpc/otelgrpc/stats_handler.go | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go b/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go index b7ddff0dd3c..0bc29b26ee7 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/stats_handler.go @@ -29,7 +29,7 @@ import ( "go.opentelemetry.io/otel/trace" ) -type grpcContext struct { +type gRPCContext struct { messagesReceived int64 messagesSent int64 } @@ -66,8 +66,8 @@ func (h *serverHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont trace.WithAttributes(attrs...), ) - gctx := grpcContext{} - return context.WithValue(ctx, grpcContext{}, &gctx) + gctx := gRPCContext{} + return context.WithValue(ctx, gRPCContext{}, &gctx) } // HandleRPC processes the RPC stats. @@ -87,7 +87,7 @@ func (h *serverHandler) TagConn(ctx context.Context, info *stats.ConnTagInfo) co func (h *serverHandler) HandleConn(ctx context.Context, info stats.ConnStats) { } -// NewClientHandler create a stats.Handler for grpc client. +// NewClientHandler creates a stats.Handler for gRPC client. func NewClientHandler(opts ...Option) stats.Handler { h := &clientHandler{ config: newConfig(opts), @@ -118,9 +118,9 @@ func (h *clientHandler) TagRPC(ctx context.Context, info *stats.RPCTagInfo) cont trace.WithAttributes(attrs...), ) - gctx := grpcContext{} + gctx := gRPCContext{} - return inject(context.WithValue(ctx, grpcContext{}, &gctx), h.config.Propagators) + return inject(context.WithValue(ctx, gRPCContext{}, &gctx), h.config.Propagators) } // HandleRPC processes the RPC stats. @@ -143,7 +143,7 @@ func (h *clientHandler) HandleConn(context.Context, stats.ConnStats) { func handleRPC(ctx context.Context, rs stats.RPCStats) { span := trace.SpanFromContext(ctx) - gctx, _ := ctx.Value(grpcContext{}).(*grpcContext) + gctx, _ := ctx.Value(gRPCContext{}).(*gRPCContext) var messageId int64 switch rs := rs.(type) {