Skip to content

Commit

Permalink
fix deprecation
Browse files Browse the repository at this point in the history
  • Loading branch information
songy23 committed Dec 16, 2024
1 parent 47a5e0e commit e188b88
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 21 deletions.
6 changes: 3 additions & 3 deletions processor/k8sattributesprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"github.com/stretchr/testify/assert"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/processor/processorprofiles"
"go.opentelemetry.io/collector/processor/processortest"
"go.opentelemetry.io/collector/processor/xprocessor"
)

func TestCreateDefaultConfig(t *testing.T) {
Expand Down Expand Up @@ -42,7 +42,7 @@ func TestCreateProcessor(t *testing.T) {
assert.NotNil(t, lp)
assert.NoError(t, err)

pp, err := factory.(processorprofiles.Factory).CreateProfiles(context.Background(), params, cfg, consumertest.NewNop())
pp, err := factory.(xprocessor.Factory).CreateProfiles(context.Background(), params, cfg, consumertest.NewNop())
assert.NotNil(t, pp)
assert.NoError(t, err)

Expand All @@ -61,7 +61,7 @@ func TestCreateProcessor(t *testing.T) {
assert.NotNil(t, lp)
assert.NoError(t, err)

pp, err = factory.(processorprofiles.Factory).CreateProfiles(context.Background(), params, cfg, consumertest.NewNop())
pp, err = factory.(xprocessor.Factory).CreateProfiles(context.Background(), params, cfg, consumertest.NewNop())
assert.NotNil(t, pp)
assert.NoError(t, err)

Expand Down
4 changes: 2 additions & 2 deletions processor/k8sattributesprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ require (
go.opentelemetry.io/collector/consumer v1.21.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/consumertest v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/xconsumer v0.0.0-20241215143820-6147243aaaa1
go.opentelemetry.io/collector/featuregate v1.21.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/pdata v1.21.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/pdata/pprofile v0.115.1-0.20241216091623-8ac40a01a5ff
Expand All @@ -28,6 +29,7 @@ require (
go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/processorprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/processortest v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/xprocessor v0.0.0-20241215143820-6147243aaaa1
go.opentelemetry.io/collector/receiver/otlpreceiver v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/receiver/receivertest v0.115.1-0.20241216091623-8ac40a01a5ff
Expand Down Expand Up @@ -101,13 +103,11 @@ require (
go.opentelemetry.io/collector/config/configtls v1.21.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/config/internal v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/consumer/consumererror v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/collector/extension v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/extension/auth v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/internal/sharedcomponent v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/pdata/testdata v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/collector/processor/xprocessor v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/collector/receiver v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/receiver/xreceiver v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc v0.56.0 // indirect
Expand Down
8 changes: 4 additions & 4 deletions processor/k8sattributesprocessor/processor_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@ import (
"go.opentelemetry.io/collector/component/componentstatus"
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumerprofiles"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/consumer/xconsumer"
"go.opentelemetry.io/collector/pdata/pcommon"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/pprofile"
"go.opentelemetry.io/collector/pdata/ptrace"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorprofiles"
"go.opentelemetry.io/collector/processor/processortest"
"go.opentelemetry.io/collector/processor/xprocessor"
conventions "go.opentelemetry.io/collector/semconv/v1.8.0"

"github.com/open-telemetry/opentelemetry-collector-contrib/internal/k8sconfig"
Expand Down Expand Up @@ -84,7 +84,7 @@ func newLogsProcessor(cfg component.Config, nextLogsConsumer consumer.Logs, opti
)
}

func newProfilesProcessor(cfg component.Config, nextProfilesConsumer consumerprofiles.Profiles, options ...option) (processorprofiles.Profiles, error) {
func newProfilesProcessor(cfg component.Config, nextProfilesConsumer xconsumer.Profiles, options ...option) (xprocessor.Profiles, error) {
opts := options
opts = append(opts, withKubeClientProvider(newFakeClient))
set := processortest.NewNopSettings()
Expand Down Expand Up @@ -118,7 +118,7 @@ type multiTest struct {
tp processor.Traces
mp processor.Metrics
lp processor.Logs
pp processorprofiles.Profiles
pp xprocessor.Profiles

nextTrace *consumertest.TracesSink
nextMetrics *consumertest.MetricsSink
Expand Down
6 changes: 3 additions & 3 deletions processor/resourcedetectionprocessor/factory_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import (
"go.opentelemetry.io/collector/component/componenttest"
"go.opentelemetry.io/collector/confmap/confmaptest"
"go.opentelemetry.io/collector/consumer/consumertest"
"go.opentelemetry.io/collector/processor/processorprofiles"
"go.opentelemetry.io/collector/processor/processortest"
"go.opentelemetry.io/collector/processor/xprocessor"
)

func TestCreateDefaultConfig(t *testing.T) {
Expand All @@ -39,7 +39,7 @@ func TestCreateProcessor(t *testing.T) {
assert.NoError(t, err)
assert.NotNil(t, lp)

pp, err := factory.(processorprofiles.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop())
pp, err := factory.(xprocessor.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop())
assert.NoError(t, err)
assert.NotNil(t, pp)
}
Expand Down Expand Up @@ -88,7 +88,7 @@ func TestInvalidConfig(t *testing.T) {
assert.Error(t, err)
assert.Nil(t, lp)

pp, err := factory.(processorprofiles.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop())
pp, err := factory.(xprocessor.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, consumertest.NewNop())
assert.Error(t, err)
assert.Nil(t, pp)
}
2 changes: 1 addition & 1 deletion processor/resourcedetectionprocessor/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ require (
go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/processorprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/processortest v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/processor/xprocessor v0.0.0-20241215143820-6147243aaaa1
go.opentelemetry.io/collector/semconv v0.115.1-0.20241216091623-8ac40a01a5ff
go.uber.org/goleak v1.3.0
go.uber.org/multierr v1.11.0
Expand Down Expand Up @@ -125,7 +126,6 @@ require (
go.opentelemetry.io/collector/pdata/testdata v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/pipeline v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/collector/processor/xprocessor v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.56.0 // indirect
go.opentelemetry.io/otel v1.32.0 // indirect
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.30.0 // indirect
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ import (
"go.opentelemetry.io/collector/pdata/pprofile"
"go.opentelemetry.io/collector/pdata/ptrace"
"go.opentelemetry.io/collector/processor"
"go.opentelemetry.io/collector/processor/processorprofiles"
"go.opentelemetry.io/collector/processor/processortest"
"go.opentelemetry.io/collector/processor/xprocessor"

"github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal"
"github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourcedetectionprocessor/internal/env"
Expand Down Expand Up @@ -365,7 +365,7 @@ func BenchmarkConsumeLogsAll(b *testing.B) {
func benchmarkConsumeProfiles(b *testing.B, cfg *Config) {
factory := NewFactory()
sink := new(consumertest.ProfilesSink)
processor, _ := factory.(processorprofiles.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, sink)
processor, _ := factory.(xprocessor.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, sink)

b.ResetTimer()
for n := 0; n < b.N; n++ {
Expand Down
4 changes: 2 additions & 2 deletions receiver/otlpjsonfilereceiver/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (

"go.opentelemetry.io/collector/component"
"go.opentelemetry.io/collector/consumer"
"go.opentelemetry.io/collector/consumer/consumerprofiles"
"go.opentelemetry.io/collector/consumer/xconsumer"
"go.opentelemetry.io/collector/pdata/plog"
"go.opentelemetry.io/collector/pdata/pmetric"
"go.opentelemetry.io/collector/pdata/pprofile"
Expand Down Expand Up @@ -177,7 +177,7 @@ func createTracesReceiver(_ context.Context, settings receiver.Settings, configu
return &otlpjsonfilereceiver{input: input, id: settings.ID, storageID: cfg.StorageID}, nil
}

func createProfilesReceiver(_ context.Context, settings receiver.Settings, configuration component.Config, profiles consumerprofiles.Profiles) (receiverprofiles.Profiles, error) {
func createProfilesReceiver(_ context.Context, settings receiver.Settings, configuration component.Config, profiles xconsumer.Profiles) (receiverprofiles.Profiles, error) {
profilesUnmarshaler := &pprofile.JSONUnmarshaler{}
cfg := configuration.(*Config)
opts := make([]fileconsumer.Option, 0)
Expand Down
3 changes: 1 addition & 2 deletions receiver/otlpjsonfilereceiver/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ require (

require (
go.opentelemetry.io/collector/component/componenttest v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/consumertest v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/consumer/xconsumer v0.0.0-20241215143820-6147243aaaa1
go.opentelemetry.io/collector/pdata/pprofile v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.1-0.20241216091623-8ac40a01a5ff
go.opentelemetry.io/collector/receiver/receivertest v0.115.1-0.20241216091623-8ac40a01a5ff
Expand Down Expand Up @@ -57,7 +57,6 @@ require (
github.com/valyala/fastjson v1.6.4 // indirect
go.opentelemetry.io/collector/config/configtelemetry v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/consumer/consumererror v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/consumer/xconsumer v0.0.0-20241215143820-6147243aaaa1 // indirect
go.opentelemetry.io/collector/extension v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/extension/experimental/storage v0.115.1-0.20241216091623-8ac40a01a5ff // indirect
go.opentelemetry.io/collector/featuregate v1.21.1-0.20241216091623-8ac40a01a5ff // indirect
Expand Down
2 changes: 0 additions & 2 deletions receiver/otlpjsonfilereceiver/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e188b88

Please sign in to comment.