diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go b/instrumentation/google.golang.org/grpc/otelgrpc/config.go similarity index 93% rename from instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go rename to instrumentation/google.golang.org/grpc/otelgrpc/config.go index d609e8d5712..ceb6b626ad0 100644 --- a/instrumentation/google.golang.org/grpc/otelgrpc/grpctrace.go +++ b/instrumentation/google.golang.org/grpc/otelgrpc/config.go @@ -121,6 +121,20 @@ func WithTracerProvider(tp trace.TracerProvider) Option { return tracerProviderOption{tp: tp} } +type meterProviderOption struct{ mp metric.MeterProvider } + +func (o meterProviderOption) apply(c *config) { + if o.mp != nil { + c.MeterProvider = o.mp + } +} + +// WithMeterProvider returns an Option to use the MeterProvider when +// creating a Meter. +func WithMeterProvider(mp metric.MeterProvider) Option { + return meterProviderOption{mp: mp} +} + type metadataSupplier struct { metadata *metadata.MD } diff --git a/instrumentation/google.golang.org/grpc/otelgrpc/grpcmetric.go b/instrumentation/google.golang.org/grpc/otelgrpc/grpcmetric.go deleted file mode 100644 index de806dc514b..00000000000 --- a/instrumentation/google.golang.org/grpc/otelgrpc/grpcmetric.go +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright The OpenTelemetry Authors -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -package otelgrpc // import "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" - -import ( - "go.opentelemetry.io/otel/metric" -) - -type meterProviderOption struct{ mp metric.MeterProvider } - -func (o meterProviderOption) apply(c *config) { - if o.mp != nil { - c.MeterProvider = o.mp - } -} - -// WithMeterProvider returns an Option to use the MeterProvider when -// creating a Meter. -func WithMeterProvider(mp metric.MeterProvider) Option { - return meterProviderOption{mp: mp} -}