diff --git a/processor/resourceprocessor/factory.go b/processor/resourceprocessor/factory.go index 7af676569cd3..903397a260bc 100644 --- a/processor/resourceprocessor/factory.go +++ b/processor/resourceprocessor/factory.go @@ -5,14 +5,13 @@ package resourceprocessor // import "github.com/open-telemetry/opentelemetry-col import ( "context" - "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/processor" "go.opentelemetry.io/collector/processor/processorhelper" - "go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles" - "go.opentelemetry.io/collector/processor/processorprofiles" + "go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper" + "go.opentelemetry.io/collector/processor/xprocessor" "github.com/open-telemetry/opentelemetry-collector-contrib/internal/coreinternal/attraction" "github.com/open-telemetry/opentelemetry-collector-contrib/processor/resourceprocessor/internal/metadata" @@ -22,13 +21,13 @@ var processorCapabilities = consumer.Capabilities{MutatesData: true} // NewFactory returns a new factory for the Resource processor. func NewFactory() processor.Factory { - return processorprofiles.NewFactory( + return xprocessor.NewFactory( metadata.Type, createDefaultConfig, - processorprofiles.WithTraces(createTracesProcessor, metadata.TracesStability), - processorprofiles.WithMetrics(createMetricsProcessor, metadata.MetricsStability), - processorprofiles.WithLogs(createLogsProcessor, metadata.LogsStability), - processorprofiles.WithProfiles(createProfilesProcessor, metadata.ProfilesStability), + xprocessor.WithTraces(createTracesProcessor, metadata.TracesStability), + xprocessor.WithMetrics(createMetricsProcessor, metadata.MetricsStability), + xprocessor.WithLogs(createLogsProcessor, metadata.LogsStability), + xprocessor.WithProfiles(createProfilesProcessor, metadata.ProfilesStability), ) } @@ -101,18 +100,18 @@ func createProfilesProcessor( ctx context.Context, set processor.Settings, cfg component.Config, - nextConsumer consumerprofiles.Profiles, -) (processorprofiles.Profiles, error) { + nextConsumer xconsumer.Profiles, +) (xprocessor.Profiles, error) { attrProc, err := attraction.NewAttrProc(&attraction.Settings{Actions: cfg.(*Config).AttributesActions}) if err != nil { return nil, err } proc := resourceProcessor{logger: set.Logger, attrProc: attrProc} - return processorhelperprofiles.NewProfiles( + return xprocessorhelper.NewProfiles( ctx, set, cfg, nextConsumer, proc.processProfiles, - processorhelperprofiles.WithCapabilities(processorCapabilities)) + xprocessorhelper.WithCapabilities(processorCapabilities)) } diff --git a/processor/resourceprocessor/factory_test.go b/processor/resourceprocessor/factory_test.go index dc2cba9aba34..89f444f1f2dc 100644 --- a/processor/resourceprocessor/factory_test.go +++ b/processor/resourceprocessor/factory_test.go @@ -5,6 +5,7 @@ package resourceprocessor import ( "context" + "go.opentelemetry.io/collector/processor/xprocessor" "testing" "github.com/stretchr/testify/assert" @@ -65,6 +66,6 @@ func TestInvalidAttributeActions(t *testing.T) { _, err = factory.CreateLogs(context.Background(), processortest.NewNopSettings(), cfg, nil) assert.Error(t, err) - _, err = factory.(processorprofiles.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, nil) + _, err = factory.(xprocessor.Factory).CreateProfiles(context.Background(), processortest.NewNopSettings(), cfg, nil) assert.Error(t, err) } diff --git a/processor/resourceprocessor/go.mod b/processor/resourceprocessor/go.mod index b5c419e14b27..ef62e4bbb628 100644 --- a/processor/resourceprocessor/go.mod +++ b/processor/resourceprocessor/go.mod @@ -10,14 +10,15 @@ require ( go.opentelemetry.io/collector/component/componenttest v0.116.0 go.opentelemetry.io/collector/confmap v1.22.0 go.opentelemetry.io/collector/consumer v1.22.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.116.0 go.opentelemetry.io/collector/consumer/consumertest v0.116.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 go.opentelemetry.io/collector/pdata v1.22.0 go.opentelemetry.io/collector/pdata/pprofile v0.116.0 go.opentelemetry.io/collector/processor v0.116.0 - go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.116.0 + go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.116.0 go.opentelemetry.io/collector/processor/processorprofiles v0.116.0 go.opentelemetry.io/collector/processor/processortest v0.116.0 + go.opentelemetry.io/collector/processor/xprocessor v0.116.0 go.uber.org/goleak v1.3.0 go.uber.org/zap v1.27.0 ) @@ -44,11 +45,8 @@ require ( go.opentelemetry.io/collector/client v1.22.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.116.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.116.0 // indirect - go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.116.0 // indirect go.opentelemetry.io/collector/pipeline v0.116.0 // indirect - go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.116.0 // indirect - go.opentelemetry.io/collector/processor/xprocessor v0.116.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect go.opentelemetry.io/otel/sdk v1.32.0 // indirect diff --git a/processor/resourceprocessor/go.sum b/processor/resourceprocessor/go.sum index eddb505afa9d..5785f868b166 100644 --- a/processor/resourceprocessor/go.sum +++ b/processor/resourceprocessor/go.sum @@ -66,8 +66,6 @@ go.opentelemetry.io/collector/confmap v1.22.0 h1:ZKQzRuj5lKu+seKArAAZ1yPRroDPric go.opentelemetry.io/collector/confmap v1.22.0/go.mod h1:Rrhs+MWoaP6AswZp+ReQ2VO9dfOfcUjdjiSHBsG+nec= go.opentelemetry.io/collector/consumer v1.22.0 h1:QmfnNizyNZFt0uK3GG/EoT5h6PvZJ0dgVTc5hFEc1l0= go.opentelemetry.io/collector/consumer v1.22.0/go.mod h1:tiz2khNceFAPokxxfzAuFfIpShBasMT2AL2Sbc7+m0I= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.116.0 h1:3UR2wcmFd19ip7aW9r3KljCyRBWhFOpdWCYSL5xQXeE= -go.opentelemetry.io/collector/consumer/consumerprofiles v0.116.0/go.mod h1:g34L7TyznLMrZqiCYsv9Q/c462rgcoYGt7JNxubZfN8= go.opentelemetry.io/collector/consumer/consumertest v0.116.0 h1:pIVR7FtQMNAzfxBUSMEIC2dX5Lfo3O9ZBfx+sAwrrrM= go.opentelemetry.io/collector/consumer/consumertest v0.116.0/go.mod h1:cV3cNDiPnls5JdhnOJJFVlclrClg9kPs04cXgYP9Gmk= go.opentelemetry.io/collector/consumer/xconsumer v0.116.0 h1:ZrWvq7HumB0jRYmS2ztZ3hhXRNpUVBWPKMbPhsVGmZM= @@ -82,8 +80,6 @@ go.opentelemetry.io/collector/pipeline v0.116.0 h1:o8eKEuWEszmRpfShy7ElBoQ3Jo6kC go.opentelemetry.io/collector/pipeline v0.116.0/go.mod h1:qE3DmoB05AW0C3lmPvdxZqd/H4po84NPzd5MrqgtL74= go.opentelemetry.io/collector/processor v0.116.0 h1:Kyu4tPzTdWNHtZjcxvI/bGNAgyv8L8Kem2r/Mk4IDAw= go.opentelemetry.io/collector/processor v0.116.0/go.mod h1:+/Ugy48RAxlZEXmN2cw51W8t5wdHS9No+GAoP+moskk= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.116.0 h1:sqhvYwsvtAuLSYU5t7SVyfA00x7aSdJ2n2L/8tnBxWE= -go.opentelemetry.io/collector/processor/processorhelper/processorhelperprofiles v0.116.0/go.mod h1:ylT9hHFuuaZ3lU/cUVQD2XZXvv5lohL956YSeTKuerg= go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.116.0 h1:1tIEJSN3HeCY602B5h2b1K6ocNn/HMNC2E+u7o3ceZA= go.opentelemetry.io/collector/processor/processorhelper/xprocessorhelper v0.116.0/go.mod h1:r8oKp+HrgZDp4L6RiNYoEk3x+LMrt9lEiCW6WiaYuJM= go.opentelemetry.io/collector/processor/processorprofiles v0.116.0 h1:/o35cUxJq1FUAeOTLYGP5AzAPLpt4qsslKxAOYdCH4Q=