diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/config.go b/instrumentation/google.golang.org/grpc/otelgrpc/config.go index 494465dc66a..bad05b6734f 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/config.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -24,8 +24,8 @@ import ( ) const ( - // ScopeName is the instrumentation scope name. - ScopeName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" + // instrumentationName is the name of this instrumentation package. + instrumentationName = "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" // GRPCStatusCodeKey is convention for numeric status code of a gRPC request. GRPCStatusCodeKey = attribute.Key("rpc.grpc.status_code") ) @@ -73,12 +73,12 @@ func newConfig(opts []Option, role string) *config { } c.tracer = c.TracerProvider.Tracer( - ScopeName, + instrumentationName, trace.WithInstrumentationVersion(SemVersion()), ) c.meter = c.MeterProvider.Meter( - ScopeName, + instrumentationName, metric.WithInstrumentationVersion(Version()), metric.WithSchemaURL(semconv.SchemaURL), ) diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go index 8ff583f0608..c737d29dcd0 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/interceptor.go @@ -63,7 +63,7 @@ var ( func UnaryClientInterceptor(opts ...Option) grpc.UnaryClientInterceptor { cfg := newConfig(opts, "client") tracer := cfg.TracerProvider.Tracer( - ScopeName, + instrumentationName, trace.WithInstrumentationVersion(Version()), ) @@ -257,7 +257,7 @@ func (w *clientStream) sendStreamEvent(eventType streamEventType, err error) { func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor { cfg := newConfig(opts, "client") tracer := cfg.TracerProvider.Tracer( - ScopeName, + instrumentationName, trace.WithInstrumentationVersion(Version()), ) @@ -327,7 +327,7 @@ func StreamClientInterceptor(opts ...Option) grpc.StreamClientInterceptor { func UnaryServerInterceptor(opts ...Option) grpc.UnaryServerInterceptor { cfg := newConfig(opts, "server") tracer := cfg.TracerProvider.Tracer( - ScopeName, + instrumentationName, trace.WithInstrumentationVersion(Version()), ) @@ -448,7 +448,7 @@ func wrapServerStream(ctx context.Context, ss grpc.ServerStream, cfg *config) *s func StreamServerInterceptor(opts ...Option) grpc.StreamServerInterceptor { cfg := newConfig(opts, "server") tracer := cfg.TracerProvider.Tracer( - ScopeName, + instrumentationName, trace.WithInstrumentationVersion(Version()), )