diff --git a/cmd/collector/app/handler/zipkin_receiver.go b/cmd/collector/app/handler/zipkin_receiver.go index 186a4ac8407..3eb582134a3 100644 --- a/cmd/collector/app/handler/zipkin_receiver.go +++ b/cmd/collector/app/handler/zipkin_receiver.go @@ -9,8 +9,10 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/receiver/zipkinreceiver" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/receiver" + "go.opentelemetry.io/otel/metric" noopmetric "go.opentelemetry.io/otel/metric/noop" nooptrace "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" @@ -64,7 +66,11 @@ func startZipkinReceiver( TelemetrySettings: component.TelemetrySettings{ Logger: logger, TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), // TODO wire this with jaegerlib metrics? + // TODO wire this with jaegerlib metrics? + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), }, } diff --git a/cmd/jaeger/internal/exporters/storageexporter/exporter_test.go b/cmd/jaeger/internal/exporters/storageexporter/exporter_test.go index ed49fc463de..fc4c8d08449 100644 --- a/cmd/jaeger/internal/exporters/storageexporter/exporter_test.go +++ b/cmd/jaeger/internal/exporters/storageexporter/exporter_test.go @@ -12,10 +12,12 @@ import ( "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/pdata/pcommon" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/otel/metric" noopmetric "go.opentelemetry.io/otel/metric/noop" nooptrace "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap/zaptest" @@ -104,7 +106,10 @@ func TestExporter(t *testing.T) { telemetrySettings := component.TelemetrySettings{ Logger: zaptest.NewLogger(t), TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), } const memstoreName = "memstore" @@ -158,7 +163,10 @@ func makeStorageExtension(t *testing.T, memstoreName string) component.Host { telemetrySettings := component.TelemetrySettings{ Logger: zaptest.NewLogger(t), TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), } extensionFactory := jaegerstorage.NewFactory() storageExtension, err := extensionFactory.CreateExtension( diff --git a/cmd/jaeger/internal/extension/jaegerquery/server_test.go b/cmd/jaeger/internal/extension/jaegerquery/server_test.go index 71da9176726..e822646640c 100644 --- a/cmd/jaeger/internal/extension/jaegerquery/server_test.go +++ b/cmd/jaeger/internal/extension/jaegerquery/server_test.go @@ -15,6 +15,8 @@ import ( "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" + "go.opentelemetry.io/collector/config/configtelemetry" + "go.opentelemetry.io/otel/metric" noopMeter "go.opentelemetry.io/otel/metric/noop" "go.uber.org/zap" "go.uber.org/zap/zaptest" @@ -187,7 +189,10 @@ func TestServerStart(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { telemetrySettings := component.TelemetrySettings{ - Logger: zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())), + Logger: zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, MeterProvider: noopMeter.NewMeterProvider(), } tt.config.HTTP.Endpoint = ":0" diff --git a/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go b/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go index 3e1ef000f7e..a6b4c8457cf 100644 --- a/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go +++ b/cmd/jaeger/internal/extension/jaegerstorage/extension_test.go @@ -16,7 +16,9 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/config/configgrpc" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/otel/metric" noopmetric "go.opentelemetry.io/otel/metric/noop" nooptrace "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" @@ -254,7 +256,10 @@ func noopTelemetrySettings() component.TelemetrySettings { return component.TelemetrySettings{ Logger: zap.L(), TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), } } diff --git a/cmd/jaeger/internal/extension/remotesampling/extension_test.go b/cmd/jaeger/internal/extension/remotesampling/extension_test.go index de8cb300e24..2378374305d 100644 --- a/cmd/jaeger/internal/extension/remotesampling/extension_test.go +++ b/cmd/jaeger/internal/extension/remotesampling/extension_test.go @@ -19,7 +19,9 @@ import ( "go.opentelemetry.io/collector/config/configgrpc" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/extension" + "go.opentelemetry.io/otel/metric" noopmetric "go.opentelemetry.io/otel/metric/noop" nooptrace "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" @@ -37,7 +39,10 @@ func makeStorageExtension(t *testing.T, memstoreName string) component.Host { telemetrySettings := component.TelemetrySettings{ Logger: zaptest.NewLogger(t), TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), } extensionFactory := jaegerstorage.NewFactory() storageExtension, err := extensionFactory.CreateExtension( diff --git a/cmd/jaeger/internal/processors/adaptivesampling/processor_test.go b/cmd/jaeger/internal/processors/adaptivesampling/processor_test.go index 69e7d83fe8f..f14c7ec8766 100644 --- a/cmd/jaeger/internal/processors/adaptivesampling/processor_test.go +++ b/cmd/jaeger/internal/processors/adaptivesampling/processor_test.go @@ -11,8 +11,10 @@ import ( "github.com/open-telemetry/opentelemetry-collector-contrib/extension/storage/storagetest" "github.com/stretchr/testify/require" "go.opentelemetry.io/collector/component" + "go.opentelemetry.io/collector/config/configtelemetry" "go.opentelemetry.io/collector/extension" "go.opentelemetry.io/collector/pdata/ptrace" + "go.opentelemetry.io/otel/metric" noopmetric "go.opentelemetry.io/otel/metric/noop" nooptrace "go.opentelemetry.io/otel/trace/noop" "go.uber.org/zap" @@ -29,7 +31,10 @@ func makeStorageExtension(t *testing.T, memstoreName string) component.Host { telemetrySettings := component.TelemetrySettings{ Logger: zaptest.NewLogger(t), TracerProvider: nooptrace.NewTracerProvider(), - MeterProvider: noopmetric.NewMeterProvider(), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, + MeterProvider: noopmetric.NewMeterProvider(), } extensionFactory := jaegerstorage.NewFactory() storageExtension, err := extensionFactory.CreateExtension( @@ -88,7 +93,10 @@ func TestNewTraceProcessor(t *testing.T) { func TestTraceProcessor(t *testing.T) { telemetrySettings := component.TelemetrySettings{ - Logger: zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())), + Logger: zaptest.NewLogger(t, zaptest.WrapOptions(zap.AddCaller())), + LeveledMeterProvider: func(level configtelemetry.Level) metric.MeterProvider { + return noopmetric.NewMeterProvider() + }, MeterProvider: noopmetric.NewMeterProvider(), } config := createDefaultConfig().(*Config)