Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Yuri Shkuro <github@ysh.us>
  • Loading branch information
yurishkuro committed Sep 11, 2024
1 parent 89e55bc commit 5b29ca4
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 8 deletions.
8 changes: 7 additions & 1 deletion cmd/collector/app/handler/zipkin_receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
},
}

Expand Down
12 changes: 10 additions & 2 deletions cmd/jaeger/internal/exporters/storageexporter/exporter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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(
Expand Down
7 changes: 6 additions & 1 deletion cmd/jaeger/internal/extension/jaegerquery/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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()

Check failure on line 194 in cmd/jaeger/internal/extension/jaegerquery/server_test.go

View workflow job for this annotation

GitHub Actions / unit-tests

undefined: noopmetric

Check failure on line 194 in cmd/jaeger/internal/extension/jaegerquery/server_test.go

View workflow job for this annotation

GitHub Actions / lint

undefined: noopmetric (typecheck)
},
MeterProvider: noopMeter.NewMeterProvider(),
}
tt.config.HTTP.Endpoint = ":0"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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(),
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand Down
12 changes: 10 additions & 2 deletions cmd/jaeger/internal/processors/adaptivesampling/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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(
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 5b29ca4

Please sign in to comment.