diff --git a/.chloggen/deprecate-consumerprofiles.yaml b/.chloggen/deprecate-consumerprofiles.yaml new file mode 100644 index 00000000000..faeaf7d337f --- /dev/null +++ b/.chloggen/deprecate-consumerprofiles.yaml @@ -0,0 +1,20 @@ +# Use this changelog template to create an entry for release notes. + +# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix' +change_type: deprecation + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: consumer + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Deprecate consumerprofiles module in favor of xconsumer to allow adding more experimental data types. + +# One or more tracking issues or pull requests related to the change +issues: [11778] + +# Optional: The change log or logs in which this entry should be included. +# e.g. '[user]' or '[user, api]' +# Include 'user' if the change is relevant to end users. +# Include 'api' if there is a change to a library API. +# Default: '[user]' +change_logs: [api] diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index e3590fe84c2..7fb77bee193 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -30,6 +30,7 @@ extension/experimental/storage @open-telemetry/collector-approvers @swiatekm # Profiling-related modules pdata/pprofile @open-telemetry/collector-approvers @mx-psi @dmathieu consumer/consumerprofiles @open-telemetry/collector-approvers @mx-psi @dmathieu +consumer/xconsumer @open-telemetry/collector-approvers @mx-psi @dmathieu connector/connectorprofiles @open-telemetry/collector-approvers @mx-psi @dmathieu exporter/exporterhelper/exporterhelperprofiles @open-telemetry/collector-approvers @mx-psi @dmathieu exporter/exporterprofiles @open-telemetry/collector-approvers @mx-psi @dmathieu diff --git a/cmd/builder/internal/builder/main_test.go b/cmd/builder/internal/builder/main_test.go index 4f0b5e7699a..04aabf367c9 100644 --- a/cmd/builder/internal/builder/main_test.go +++ b/cmd/builder/internal/builder/main_test.go @@ -62,7 +62,7 @@ var replaceModules = []string{ "/consumer", "/consumer/consumererror", "/consumer/consumererror/consumererrorprofiles", - "/consumer/consumerprofiles", + "/consumer/xconsumer", "/consumer/consumertest", "/connector", "/connector/connectortest", diff --git a/cmd/mdatagen/go.mod b/cmd/mdatagen/go.mod index 639a7a30e8b..7ce61497a3f 100644 --- a/cmd/mdatagen/go.mod +++ b/cmd/mdatagen/go.mod @@ -48,7 +48,7 @@ require ( github.com/spf13/pflag v1.0.5 // indirect go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect @@ -97,7 +97,7 @@ retract ( replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/cmd/otelcorecol/builder-config.yaml b/cmd/otelcorecol/builder-config.yaml index 4d71ea810ec..e46b700c6bf 100644 --- a/cmd/otelcorecol/builder-config.yaml +++ b/cmd/otelcorecol/builder-config.yaml @@ -59,7 +59,7 @@ replaces: - go.opentelemetry.io/collector/confmap/provider/httpsprovider => ../../confmap/provider/httpsprovider - go.opentelemetry.io/collector/confmap/provider/yamlprovider => ../../confmap/provider/yamlprovider - go.opentelemetry.io/collector/consumer => ../../consumer - - go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles + - go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer - go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror - go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles => ../../consumer/consumererror/consumererrorprofiles - go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/cmd/otelcorecol/go.mod b/cmd/otelcorecol/go.mod index 54c77922199..2e0b781ccf2 100644 --- a/cmd/otelcorecol/go.mod +++ b/cmd/otelcorecol/go.mod @@ -98,8 +98,8 @@ require ( go.opentelemetry.io/collector/consumer v1.21.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exportertest v0.115.0 // indirect @@ -203,7 +203,7 @@ replace go.opentelemetry.io/collector/confmap/provider/yamlprovider => ../../con replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror diff --git a/connector/connectorprofiles/connector.go b/connector/connectorprofiles/connector.go index 589e3089b55..bd66013824d 100644 --- a/connector/connectorprofiles/connector.go +++ b/connector/connectorprofiles/connector.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/internal" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) @@ -18,15 +18,15 @@ import ( type Factory interface { connector.Factory - CreateTracesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Traces, error) - CreateMetricsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Metrics, error) - CreateLogsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Logs, error) + CreateTracesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Traces, error) + CreateMetricsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Metrics, error) + CreateLogsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Logs, error) TracesToProfilesStability() component.StabilityLevel MetricsToProfilesStability() component.StabilityLevel LogsToProfilesStability() component.StabilityLevel - CreateProfilesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) + CreateProfilesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) CreateProfilesToTraces(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Traces) (Profiles, error) CreateProfilesToMetrics(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Metrics) (Profiles, error) CreateProfilesToLogs(ctx context.Context, set connector.Settings, cfg component.Config, next consumer.Logs) (Profiles, error) @@ -39,7 +39,7 @@ type Factory interface { // A Profiles connector acts as an exporter from a profiles pipeline and a receiver // to one or more traces, metrics, logs, or profiles pipelines. -// Profiles feeds a consumer.Traces, consumer.Metrics, consumer.Logs, or consumerprofiles.Profiles with data. +// Profiles feeds a consumer.Traces, consumer.Metrics, consumer.Logs, or xconsumer.Profiles with data. // // Examples: // - Profiles could be collected in one pipeline and routed to another profiles pipeline @@ -51,14 +51,14 @@ type Factory interface { // criteria are met. type Profiles interface { component.Component - consumerprofiles.Profiles + xconsumer.Profiles } // CreateTracesToProfilesFunc is the equivalent of Factory.CreateTracesToProfiles(). -type CreateTracesToProfilesFunc func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) +type CreateTracesToProfilesFunc func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Traces, error) // CreateTracesToProfiles implements Factory.CreateTracesToProfiles(). -func (f CreateTracesToProfilesFunc) CreateTracesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Traces, error) { +func (f CreateTracesToProfilesFunc) CreateTracesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Traces, error) { if f == nil { return nil, internal.ErrDataTypes(set.ID, pipeline.SignalTraces, pipelineprofiles.SignalProfiles) } @@ -66,10 +66,10 @@ func (f CreateTracesToProfilesFunc) CreateTracesToProfiles(ctx context.Context, } // CreateMetricsToProfilesFunc is the equivalent of Factory.CreateMetricsToProfiles(). -type CreateMetricsToProfilesFunc func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) +type CreateMetricsToProfilesFunc func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Metrics, error) // CreateMetricsToProfiles implements Factory.CreateMetricsToProfiles(). -func (f CreateMetricsToProfilesFunc) CreateMetricsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Metrics, error) { +func (f CreateMetricsToProfilesFunc) CreateMetricsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Metrics, error) { if f == nil { return nil, internal.ErrDataTypes(set.ID, pipeline.SignalMetrics, pipelineprofiles.SignalProfiles) } @@ -77,10 +77,10 @@ func (f CreateMetricsToProfilesFunc) CreateMetricsToProfiles(ctx context.Context } // CreateLogsToProfilesFunc is the equivalent of Factory.CreateLogsToProfiles(). -type CreateLogsToProfilesFunc func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) +type CreateLogsToProfilesFunc func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Logs, error) // CreateLogsToProfiles implements Factory.CreateLogsToProfiles(). -func (f CreateLogsToProfilesFunc) CreateLogsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (connector.Logs, error) { +func (f CreateLogsToProfilesFunc) CreateLogsToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (connector.Logs, error) { if f == nil { return nil, internal.ErrDataTypes(set.ID, pipeline.SignalLogs, pipelineprofiles.SignalProfiles) } @@ -88,10 +88,10 @@ func (f CreateLogsToProfilesFunc) CreateLogsToProfiles(ctx context.Context, set } // CreateProfilesToProfilesFunc is the equivalent of Factory.CreateProfilesToProfiles(). -type CreateProfilesToProfilesFunc func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) +type CreateProfilesToProfilesFunc func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (Profiles, error) // CreateProfilesToProfiles implements Factory.CreateProfilesToProfiles(). -func (f CreateProfilesToProfilesFunc) CreateProfilesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) { +func (f CreateProfilesToProfilesFunc) CreateProfilesToProfiles(ctx context.Context, set connector.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) { if f == nil { return nil, internal.ErrDataTypes(set.ID, pipelineprofiles.SignalProfiles, pipelineprofiles.SignalProfiles) } diff --git a/connector/connectorprofiles/connector_test.go b/connector/connectorprofiles/connector_test.go index 0a1a9851d95..e3cbd0615c4 100644 --- a/connector/connectorprofiles/connector_test.go +++ b/connector/connectorprofiles/connector_test.go @@ -14,8 +14,8 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/internal" "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/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) @@ -119,19 +119,19 @@ type nopConnector struct { consumertest.Consumer } -func createTracesToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) { +func createTracesToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Traces, error) { return nopInstance, nil } -func createMetricsToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) { +func createMetricsToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Metrics, error) { return nopInstance, nil } -func createLogsToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) { +func createLogsToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Logs, error) { return nopInstance, nil } -func createProfilesToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) { +func createProfilesToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (Profiles, error) { return nopInstance, nil } diff --git a/connector/connectorprofiles/go.mod b/connector/connectorprofiles/go.mod index 6bf506f065c..7d58c4160ea 100644 --- a/connector/connectorprofiles/go.mod +++ b/connector/connectorprofiles/go.mod @@ -7,8 +7,8 @@ require ( go.opentelemetry.io/collector/component v0.115.0 go.opentelemetry.io/collector/connector v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/pdata/testdata v0.115.0 @@ -47,7 +47,7 @@ replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/co replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/component => ../../component diff --git a/connector/connectorprofiles/profiles_router.go b/connector/connectorprofiles/profiles_router.go index c171d166ef2..fb5d8b01970 100644 --- a/connector/connectorprofiles/profiles_router.go +++ b/connector/connectorprofiles/profiles_router.go @@ -5,25 +5,25 @@ package connectorprofiles // import "go.opentelemetry.io/collector/connector/con import ( "go.opentelemetry.io/collector/connector/internal" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/pipeline" ) type ProfilesRouterAndConsumer interface { - consumerprofiles.Profiles - Consumer(...pipeline.ID) (consumerprofiles.Profiles, error) + xconsumer.Profiles + Consumer(...pipeline.ID) (xconsumer.Profiles, error) PipelineIDs() []pipeline.ID privateFunc() } type profilesRouter struct { - consumerprofiles.Profiles - internal.BaseRouter[consumerprofiles.Profiles] + xconsumer.Profiles + internal.BaseRouter[xconsumer.Profiles] } -func NewProfilesRouter(cm map[pipeline.ID]consumerprofiles.Profiles) ProfilesRouterAndConsumer { - consumers := make([]consumerprofiles.Profiles, 0, len(cm)) +func NewProfilesRouter(cm map[pipeline.ID]xconsumer.Profiles) ProfilesRouterAndConsumer { + consumers := make([]xconsumer.Profiles, 0, len(cm)) for _, cons := range cm { consumers = append(consumers, cons) } diff --git a/connector/connectorprofiles/profiles_router_test.go b/connector/connectorprofiles/profiles_router_test.go index 68b8aa27957..5ff72b68aef 100644 --- a/connector/connectorprofiles/profiles_router_test.go +++ b/connector/connectorprofiles/profiles_router_test.go @@ -13,8 +13,8 @@ import ( "github.com/stretchr/testify/require" "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/pprofile" "go.opentelemetry.io/collector/pdata/testdata" "go.opentelemetry.io/collector/pipeline" @@ -46,8 +46,8 @@ func TestProfilesRouterMultiplexing(t *testing.T) { func fuzzProfiles(numIDs, numCons, numProfiles int) func(*testing.T) { return func(t *testing.T) { allIDs := make([]pipeline.ID, 0, numCons) - allCons := make([]consumerprofiles.Profiles, 0, numCons) - allConsMap := make(map[pipeline.ID]consumerprofiles.Profiles) + allCons := make([]xconsumer.Profiles, 0, numCons) + allConsMap := make(map[pipeline.ID]xconsumer.Profiles) // If any consumer is mutating, the router must report mutating for i := 0; i < numCons; i++ { @@ -116,7 +116,7 @@ func TestProfilessRouterConsumer(t *testing.T) { foo := new(consumertest.ProfilesSink) bar := new(consumertest.ProfilesSink) - r := NewProfilesRouter(map[pipeline.ID]consumerprofiles.Profiles{fooID: foo, barID: bar}) + r := NewProfilesRouter(map[pipeline.ID]xconsumer.Profiles{fooID: foo, barID: bar}) rcs := r.PipelineIDs() assert.Len(t, rcs, 2) diff --git a/connector/connectortest/connector.go b/connector/connectortest/connector.go index bbedb7e2623..8659063c0d1 100644 --- a/connector/connectortest/connector.go +++ b/connector/connectortest/connector.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer/xconsumer" ) var nopType = component.MustNewType("nop") @@ -68,7 +68,7 @@ func createTracesToLogsConnector(context.Context, connector.Settings, component. return &nopConnector{Consumer: consumertest.NewNop()}, nil } -func createTracesToProfilesConnector(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) { +func createTracesToProfilesConnector(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Traces, error) { return &nopConnector{Consumer: consumertest.NewNop()}, nil } @@ -84,7 +84,7 @@ func createMetricsToLogsConnector(context.Context, connector.Settings, component return &nopConnector{Consumer: consumertest.NewNop()}, nil } -func createMetricsToProfilesConnector(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) { +func createMetricsToProfilesConnector(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Metrics, error) { return &nopConnector{Consumer: consumertest.NewNop()}, nil } @@ -100,7 +100,7 @@ func createLogsToLogsConnector(context.Context, connector.Settings, component.Co return &nopConnector{Consumer: consumertest.NewNop()}, nil } -func createLogsToProfilesConnector(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) { +func createLogsToProfilesConnector(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Logs, error) { return &nopConnector{Consumer: consumertest.NewNop()}, nil } @@ -116,7 +116,7 @@ func createProfilesToLogsConnector(context.Context, connector.Settings, componen return &nopConnector{Consumer: consumertest.NewNop()}, nil } -func createProfilesToProfilesConnector(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { +func createProfilesToProfilesConnector(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connectorprofiles.Profiles, error) { return &nopConnector{Consumer: consumertest.NewNop()}, nil } diff --git a/connector/connectortest/go.mod b/connector/connectortest/go.mod index fa89c004b26..91b3a952a8e 100644 --- a/connector/connectortest/go.mod +++ b/connector/connectortest/go.mod @@ -10,8 +10,8 @@ require ( go.opentelemetry.io/collector/connector v0.115.0 go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.uber.org/goleak v1.3.0 @@ -58,7 +58,7 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/connector/forwardconnector/go.mod b/connector/forwardconnector/go.mod index 10d320a2eca..3b6223ce1d7 100644 --- a/connector/forwardconnector/go.mod +++ b/connector/forwardconnector/go.mod @@ -34,7 +34,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline/pipelineprofiles v0.115.0 // indirect @@ -79,7 +79,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/connector/go.mod b/connector/go.mod index 2bbf94a1488..916401983c8 100644 --- a/connector/go.mod +++ b/connector/go.mod @@ -24,7 +24,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect github.com/rogpeppe/go-internal v1.12.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/otel v1.32.0 // indirect go.opentelemetry.io/otel/metric v1.32.0 // indirect @@ -51,7 +51,7 @@ replace go.opentelemetry.io/collector/pdata/testdata => ../pdata/testdata replace go.opentelemetry.io/collector/pdata/pprofile => ../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/consumer/consumerprofiles/go.mod b/consumer/consumerprofiles/go.mod index bcd1acc413d..473010818d6 100644 --- a/consumer/consumerprofiles/go.mod +++ b/consumer/consumerprofiles/go.mod @@ -8,9 +8,12 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/consumer => ../ +replace go.opentelemetry.io/collector/consumer/xconsumer => ../xconsumer + require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/consumer v1.21.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.0.0-00010101000000-000000000000 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 ) diff --git a/consumer/consumerprofiles/profiles.go b/consumer/consumerprofiles/profiles.go index 7ab6b864dff..0d5665c3ba1 100644 --- a/consumer/consumerprofiles/profiles.go +++ b/consumer/consumerprofiles/profiles.go @@ -1,47 +1,29 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Deprecated: [0.115.0] This package is deprecated. Use "go.opentelemetry.io/collector/consumer/xconsumer" instead. package consumerprofiles // import "go.opentelemetry.io/collector/consumer/consumerprofiles" import ( - "context" "errors" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/internal" - "go.opentelemetry.io/collector/pdata/pprofile" + "go.opentelemetry.io/collector/consumer/xconsumer" ) var errNilFunc = errors.New("nil consumer func") // Profiles is an interface that receives pprofile.Profiles, processes it // as needed, and sends it to the next processing node if any or to the destination. -type Profiles interface { - internal.BaseConsumer - // ConsumeProfiles receives pprofile.Profiles for consumption. - ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error -} +// Deprecated: [0.115.0] Use xconsumer.Profiles instead. +type Profiles = xconsumer.Profiles // ConsumeProfilesFunc is a helper function that is similar to ConsumeProfiles. -type ConsumeProfilesFunc func(ctx context.Context, td pprofile.Profiles) error - -// ConsumeProfiles calls f(ctx, td). -func (f ConsumeProfilesFunc) ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error { - return f(ctx, td) -} - -type baseProfiles struct { - *internal.BaseImpl - ConsumeProfilesFunc -} +// Deprecated: [0.115.0] Use xconsumer.ConsumeProfilesFunc instead. +type ConsumeProfilesFunc = xconsumer.ConsumeProfilesFunc // NewProfiles returns a Profiles configured with the provided options. +// Deprecated: [0.115.0] Use xconsumer.NewProfiles instead. func NewProfiles(consume ConsumeProfilesFunc, options ...consumer.Option) (Profiles, error) { - if consume == nil { - return nil, errNilFunc - } - return &baseProfiles{ - BaseImpl: internal.NewBaseImpl(options...), - ConsumeProfilesFunc: consume, - }, nil + return xconsumer.NewProfiles(consume, options...) } diff --git a/consumer/consumerprofiles/profiles_test.go b/consumer/consumerprofiles/profiles_test.go index a9abead7bae..7c2d62ff643 100644 --- a/consumer/consumerprofiles/profiles_test.go +++ b/consumer/consumerprofiles/profiles_test.go @@ -1,6 +1,7 @@ // Copyright The OpenTelemetry Authors // SPDX-License-Identifier: Apache-2.0 +// Deprecated: [0.115.0] This package is deprecated. Use "go.opentelemetry.io/collector/consumer/xconsumer" instead. package consumerprofiles import ( diff --git a/consumer/consumertest/consumer.go b/consumer/consumertest/consumer.go index 1d9d4051af1..ec7a3030631 100644 --- a/consumer/consumertest/consumer.go +++ b/consumer/consumertest/consumer.go @@ -7,7 +7,7 @@ import ( "context" "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" @@ -31,17 +31,17 @@ type Consumer interface { // ConsumeLogs to implement the consumer.Logs. ConsumeLogs(context.Context, plog.Logs) error - // ConsumeProfiles to implement the consumerprofiles.Profiles. + // ConsumeProfiles to implement the xconsumer.Profiles. ConsumeProfiles(context.Context, pprofile.Profiles) error unexported() } var ( - _ consumer.Logs = (Consumer)(nil) - _ consumer.Metrics = (Consumer)(nil) - _ consumer.Traces = (Consumer)(nil) - _ consumerprofiles.Profiles = (Consumer)(nil) + _ consumer.Logs = (Consumer)(nil) + _ consumer.Metrics = (Consumer)(nil) + _ consumer.Traces = (Consumer)(nil) + _ xconsumer.Profiles = (Consumer)(nil) ) type nonMutatingConsumer struct{} @@ -56,7 +56,7 @@ type baseConsumer struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc - consumerprofiles.ConsumeProfilesFunc + xconsumer.ConsumeProfilesFunc } func (bc baseConsumer) unexported() {} diff --git a/consumer/consumertest/go.mod b/consumer/consumertest/go.mod index 6dcae89c341..8613dc4ef0f 100644 --- a/consumer/consumertest/go.mod +++ b/consumer/consumertest/go.mod @@ -7,7 +7,7 @@ replace go.opentelemetry.io/collector/consumer => ../ require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/pdata/testdata v0.115.0 @@ -35,6 +35,6 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile replace go.opentelemetry.io/collector/pdata => ../../pdata -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../xconsumer replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata diff --git a/consumer/consumertest/sink.go b/consumer/consumertest/sink.go index a6d2a424ee1..e05dfccff98 100644 --- a/consumer/consumertest/sink.go +++ b/consumer/consumertest/sink.go @@ -8,7 +8,7 @@ import ( "sync" "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" @@ -159,7 +159,7 @@ func (sle *LogsSink) Reset() { sle.logRecordCount = 0 } -// ProfilesSink is a consumerprofiles.Profiles that acts like a sink that +// ProfilesSink is a xconsumer.Profiles that acts like a sink that // stores all profiles and allows querying them for testing. type ProfilesSink struct { nonMutatingConsumer @@ -168,7 +168,7 @@ type ProfilesSink struct { sampleCount int } -var _ consumerprofiles.Profiles = (*ProfilesSink)(nil) +var _ xconsumer.Profiles = (*ProfilesSink)(nil) // ConsumeProfiles stores profiles to this sink. func (ste *ProfilesSink) ConsumeProfiles(_ context.Context, td pprofile.Profiles) error { diff --git a/consumer/xconsumer/Makefile b/consumer/xconsumer/Makefile new file mode 100644 index 00000000000..ded7a36092d --- /dev/null +++ b/consumer/xconsumer/Makefile @@ -0,0 +1 @@ +include ../../Makefile.Common diff --git a/consumer/xconsumer/go.mod b/consumer/xconsumer/go.mod new file mode 100644 index 00000000000..b786829699f --- /dev/null +++ b/consumer/xconsumer/go.mod @@ -0,0 +1,33 @@ +module go.opentelemetry.io/collector/consumer/xconsumer + +go 1.22.0 + +require ( + github.com/stretchr/testify v1.10.0 + go.opentelemetry.io/collector/consumer v0.114.0 + go.opentelemetry.io/collector/pdata/pprofile v0.114.0 +) + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/gogo/protobuf v1.3.2 // indirect + github.com/json-iterator/go v1.1.12 // indirect + github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect + github.com/modern-go/reflect2 v1.0.2 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + go.opentelemetry.io/collector/pdata v1.21.0 // indirect + go.uber.org/multierr v1.11.0 // indirect + golang.org/x/net v0.29.0 // indirect + golang.org/x/sys v0.25.0 // indirect + golang.org/x/text v0.18.0 // indirect + google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 // indirect + google.golang.org/grpc v1.68.1 // indirect + google.golang.org/protobuf v1.35.2 // indirect + gopkg.in/yaml.v3 v3.0.1 // indirect +) + +replace go.opentelemetry.io/collector/pdata => ../../pdata + +replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile + +replace go.opentelemetry.io/collector/consumer => ../ diff --git a/consumer/xconsumer/go.sum b/consumer/xconsumer/go.sum new file mode 100644 index 00000000000..d8a3bf3feba --- /dev/null +++ b/consumer/xconsumer/go.sum @@ -0,0 +1,79 @@ +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= +github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= +github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= +github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek= +github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps= +github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI= +github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= +github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM= +github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo= +github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8= +github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck= +github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= +github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY= +github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE= +github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg= +github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q= +github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M= +github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk= +github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI= +github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA= +github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= +github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74= +go.uber.org/goleak v1.3.0 h1:2K3zAYmnTNqV73imy9J1T3WC+gmCePx2hEGkimedGto= +go.uber.org/goleak v1.3.0/go.mod h1:CoHD4mav9JJNrW/WLlf7HGZPjdw8EucARQHekz1X6bE= +go.uber.org/multierr v1.11.0 h1:blXXJkSxSSfBVBlC76pxqeO+LN3aDfLQo+309xJstO0= +go.uber.org/multierr v1.11.0/go.mod h1:20+QtiLqy0Nd6FdQB9TLXag12DsQkrbs3htMFfDN80Y= +golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= +golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= +golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= +golang.org/x/net v0.29.0 h1:5ORfpBpCs4HzDYoodCDBbwHzdR5UrLBZ3sOnUJmFoHo= +golang.org/x/net v0.29.0/go.mod h1:gLkgy8jTGERgjzMic6DS9+SP0ajcu6Xu3Orq/SpETg0= +golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= +golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.25.0 h1:r+8e+loiHxRqhXVl6ML1nO3l1+oFoWbnlu2Ehimmi34= +golang.org/x/sys v0.25.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.18.0 h1:XvMDiNzPAl0jr17s6W9lcaIhGUfUORdGCNsuLmPG224= +golang.org/x/text v0.18.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY= +golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE= +golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA= +golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1 h1:pPJltXNxVzT4pK9yD8vR9X75DaWYYmLGMsEvBfFQZzQ= +google.golang.org/genproto/googleapis/rpc v0.0.0-20240903143218-8af14fe29dc1/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU= +google.golang.org/grpc v1.68.1 h1:oI5oTa11+ng8r8XMMN7jAOmWfPZWbYpCFaMUTACxkM0= +google.golang.org/grpc v1.68.1/go.mod h1:+q1XYFJjShcqn0QZHvCyeR4CXPA+llXIeUIfIe00waw= +google.golang.org/protobuf v1.35.2 h1:8Ar7bF+apOIoThw1EdZl0p1oWvMqTHmpA2fRTyZO8io= +google.golang.org/protobuf v1.35.2/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk= +gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q= +gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= +gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= diff --git a/consumer/xconsumer/profiles.go b/consumer/xconsumer/profiles.go new file mode 100644 index 00000000000..88ba2eb5a38 --- /dev/null +++ b/consumer/xconsumer/profiles.go @@ -0,0 +1,47 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package xconsumer // import "go.opentelemetry.io/collector/consumer/xconsumer" + +import ( + "context" + "errors" + + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/consumer/internal" + "go.opentelemetry.io/collector/pdata/pprofile" +) + +var errNilFunc = errors.New("nil consumer func") + +// Profiles is an interface that receives pprofile.Profiles, processes it +// as needed, and sends it to the next processing node if any or to the destination. +type Profiles interface { + internal.BaseConsumer + // ConsumeProfiles receives pprofile.Profiles for consumption. + ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error +} + +// ConsumeProfilesFunc is a helper function that is similar to ConsumeProfiles. +type ConsumeProfilesFunc func(ctx context.Context, td pprofile.Profiles) error + +// ConsumeProfiles calls f(ctx, td). +func (f ConsumeProfilesFunc) ConsumeProfiles(ctx context.Context, td pprofile.Profiles) error { + return f(ctx, td) +} + +type baseProfiles struct { + *internal.BaseImpl + ConsumeProfilesFunc +} + +// NewProfiles returns a Profiles configured with the provided options. +func NewProfiles(consume ConsumeProfilesFunc, options ...consumer.Option) (Profiles, error) { + if consume == nil { + return nil, errNilFunc + } + return &baseProfiles{ + BaseImpl: internal.NewBaseImpl(options...), + ConsumeProfilesFunc: consume, + }, nil +} diff --git a/consumer/xconsumer/profiles_test.go b/consumer/xconsumer/profiles_test.go new file mode 100644 index 00000000000..77cd8704ebf --- /dev/null +++ b/consumer/xconsumer/profiles_test.go @@ -0,0 +1,52 @@ +// Copyright The OpenTelemetry Authors +// SPDX-License-Identifier: Apache-2.0 + +package xconsumer + +import ( + "context" + "errors" + "testing" + + "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" + + "go.opentelemetry.io/collector/consumer" + "go.opentelemetry.io/collector/pdata/pprofile" +) + +func TestDefaultProfiles(t *testing.T) { + cp, err := NewProfiles(func(context.Context, pprofile.Profiles) error { return nil }) + assert.NoError(t, err) + assert.NoError(t, cp.ConsumeProfiles(context.Background(), pprofile.NewProfiles())) + assert.Equal(t, consumer.Capabilities{MutatesData: false}, cp.Capabilities()) +} + +func TestNilFuncProfiles(t *testing.T) { + _, err := NewProfiles(nil) + assert.Equal(t, errNilFunc, err) +} + +func TestWithCapabilitiesProfiles(t *testing.T) { + cp, err := NewProfiles( + func(context.Context, pprofile.Profiles) error { return nil }, + consumer.WithCapabilities(consumer.Capabilities{MutatesData: true})) + assert.NoError(t, err) + assert.NoError(t, cp.ConsumeProfiles(context.Background(), pprofile.NewProfiles())) + assert.Equal(t, consumer.Capabilities{MutatesData: true}, cp.Capabilities()) +} + +func TestConsumeProfiles(t *testing.T) { + consumeCalled := false + cp, err := NewProfiles(func(context.Context, pprofile.Profiles) error { consumeCalled = true; return nil }) + assert.NoError(t, err) + assert.NoError(t, cp.ConsumeProfiles(context.Background(), pprofile.NewProfiles())) + assert.True(t, consumeCalled) +} + +func TestConsumeProfiles_ReturnError(t *testing.T) { + want := errors.New("my_error") + cp, err := NewProfiles(func(context.Context, pprofile.Profiles) error { return want }) + require.NoError(t, err) + assert.Equal(t, want, cp.ConsumeProfiles(context.Background(), pprofile.NewProfiles())) +} diff --git a/exporter/debugexporter/go.mod b/exporter/debugexporter/go.mod index ee8dd178de1..87da2af3cb5 100644 --- a/exporter/debugexporter/go.mod +++ b/exporter/debugexporter/go.mod @@ -42,8 +42,8 @@ require ( go.opentelemetry.io/collector/config/configretry v1.21.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect go.opentelemetry.io/collector/featuregate v1.21.0 // indirect @@ -96,7 +96,7 @@ replace go.opentelemetry.io/collector/config/configretry => ../../config/configr replace go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles => ../../consumer/consumererror/consumererrorprofiles -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/exporter/exporterhelper/exporterhelperprofiles/go.mod b/exporter/exporterhelper/exporterhelperprofiles/go.mod index f7c8a939b5b..45c70c4cbb1 100644 --- a/exporter/exporterhelper/exporterhelperprofiles/go.mod +++ b/exporter/exporterhelper/exporterhelperprofiles/go.mod @@ -10,8 +10,8 @@ require ( go.opentelemetry.io/collector/consumer v1.21.0 go.opentelemetry.io/collector/consumer/consumererror v0.115.0 go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/exporter v0.115.0 go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 go.opentelemetry.io/collector/exporter/exportertest v0.115.0 @@ -71,7 +71,7 @@ replace go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofil replace go.opentelemetry.io/collector/receiver => ../../../receiver -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../../consumer/xconsumer replace go.opentelemetry.io/collector/component => ../../../component diff --git a/exporter/exporterhelper/exporterhelperprofiles/profiles.go b/exporter/exporterhelper/exporterhelperprofiles/profiles.go index bb6aa00de5c..ca33c94c1a9 100644 --- a/exporter/exporterhelper/exporterhelperprofiles/profiles.go +++ b/exporter/exporterhelper/exporterhelperprofiles/profiles.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" @@ -29,17 +29,17 @@ var ( type profilesRequest struct { pd pprofile.Profiles - pusher consumerprofiles.ConsumeProfilesFunc + pusher xconsumer.ConsumeProfilesFunc } -func newProfilesRequest(pd pprofile.Profiles, pusher consumerprofiles.ConsumeProfilesFunc) exporterhelper.Request { +func newProfilesRequest(pd pprofile.Profiles, pusher xconsumer.ConsumeProfilesFunc) exporterhelper.Request { return &profilesRequest{ pd: pd, pusher: pusher, } } -func newProfileRequestUnmarshalerFunc(pusher consumerprofiles.ConsumeProfilesFunc) exporterqueue.Unmarshaler[exporterhelper.Request] { +func newProfileRequestUnmarshalerFunc(pusher xconsumer.ConsumeProfilesFunc) exporterqueue.Unmarshaler[exporterhelper.Request] { return func(bytes []byte) (exporterhelper.Request, error) { profiles, err := profilesUnmarshaler.UnmarshalProfiles(bytes) if err != nil { @@ -71,7 +71,7 @@ func (req *profilesRequest) ItemsCount() int { type profileExporter struct { *internal.BaseExporter - consumerprofiles.Profiles + xconsumer.Profiles } // NewProfilesExporter creates an exporterprofiles.Profiles that records observability metrics and wraps every request with a Span. @@ -79,7 +79,7 @@ func NewProfilesExporter( ctx context.Context, set exporter.Settings, cfg component.Config, - pusher consumerprofiles.ConsumeProfilesFunc, + pusher xconsumer.ConsumeProfilesFunc, options ...exporterhelper.Option, ) (exporterprofiles.Profiles, error) { if cfg == nil { @@ -100,7 +100,7 @@ func NewProfilesExporter( type RequestFromProfilesFunc func(context.Context, pprofile.Profiles) (exporterhelper.Request, error) // requestFromProfiles returns a RequestFromProfilesFunc that converts pprofile.Profiles into a Request. -func requestFromProfiles(pusher consumerprofiles.ConsumeProfilesFunc) RequestFromProfilesFunc { +func requestFromProfiles(pusher xconsumer.ConsumeProfilesFunc) RequestFromProfilesFunc { return func(_ context.Context, profiles pprofile.Profiles) (exporterhelper.Request, error) { return newProfilesRequest(profiles, pusher), nil } @@ -128,7 +128,7 @@ func NewProfilesRequestExporter( return nil, err } - tc, err := consumerprofiles.NewProfiles(func(ctx context.Context, pd pprofile.Profiles) error { + tc, err := xconsumer.NewProfiles(func(ctx context.Context, pd pprofile.Profiles) error { req, cErr := converter(ctx, pd) if cErr != nil { set.Logger.Error("Failed to convert profiles. Dropping data.", diff --git a/exporter/exporterhelper/exporterhelperprofiles/profiles_test.go b/exporter/exporterhelper/exporterhelperprofiles/profiles_test.go index da6aa3126c1..d8b9c7c7cbb 100644 --- a/exporter/exporterhelper/exporterhelperprofiles/profiles_test.go +++ b/exporter/exporterhelper/exporterhelperprofiles/profiles_test.go @@ -24,8 +24,8 @@ import ( "go.opentelemetry.io/collector/consumer" "go.opentelemetry.io/collector/consumer/consumererror" "go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles" - "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/exporter/exporterhelper" "go.opentelemetry.io/collector/exporter/exporterhelper/internal" @@ -284,7 +284,7 @@ func TestProfilesRequestExporter_WithShutdown_ReturnError(t *testing.T) { assert.Equal(t, want, le.Shutdown(context.Background())) } -func newPushProfilesData(retError error) consumerprofiles.ConsumeProfilesFunc { +func newPushProfilesData(retError error) xconsumer.ConsumeProfilesFunc { return func(_ context.Context, _ pprofile.Profiles) error { return retError } diff --git a/exporter/exporterprofiles/exporter.go b/exporter/exporterprofiles/exporter.go index e5b19b35bf0..bd1a9dd1154 100644 --- a/exporter/exporterprofiles/exporter.go +++ b/exporter/exporterprofiles/exporter.go @@ -7,7 +7,7 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/exporter" "go.opentelemetry.io/collector/pipeline" ) @@ -15,7 +15,7 @@ import ( // Profiles is an exporter that can consume profiles. type Profiles interface { component.Component - consumerprofiles.Profiles + xconsumer.Profiles } type Factory interface { diff --git a/exporter/exporterprofiles/go.mod b/exporter/exporterprofiles/go.mod index a479f4cb55a..c9bb7a815c3 100644 --- a/exporter/exporterprofiles/go.mod +++ b/exporter/exporterprofiles/go.mod @@ -5,8 +5,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/exporter v0.115.0 go.opentelemetry.io/collector/pipeline v0.115.0 ) @@ -36,7 +36,7 @@ require ( gopkg.in/yaml.v3 v3.0.1 // indirect ) -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/extension => ../../extension diff --git a/exporter/exportertest/go.mod b/exporter/exportertest/go.mod index 4e4f505fb93..13131db4509 100644 --- a/exporter/exportertest/go.mod +++ b/exporter/exportertest/go.mod @@ -33,7 +33,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect go.opentelemetry.io/collector/featuregate v1.21.0 // indirect @@ -83,7 +83,7 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/component/componenttest => ../../component/componenttest -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/pdata/testdata => ../../pdata/testdata diff --git a/exporter/go.mod b/exporter/go.mod index e6a666e527b..98553fce0c7 100644 --- a/exporter/go.mod +++ b/exporter/go.mod @@ -41,7 +41,7 @@ require ( github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/receiver v0.115.0 // indirect @@ -82,7 +82,7 @@ replace go.opentelemetry.io/collector/config/configretry => ../config/configretr replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/exporter/nopexporter/go.mod b/exporter/nopexporter/go.mod index 023f51ef809..1b19c7e6779 100644 --- a/exporter/nopexporter/go.mod +++ b/exporter/nopexporter/go.mod @@ -33,7 +33,7 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/consumer v1.21.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect @@ -82,7 +82,7 @@ replace go.opentelemetry.io/collector/extension/experimental/storage => ../../ex replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/exporter/otlpexporter/go.mod b/exporter/otlpexporter/go.mod index bf3689d56a6..2e829091c45 100644 --- a/exporter/otlpexporter/go.mod +++ b/exporter/otlpexporter/go.mod @@ -57,8 +57,8 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/config/internal v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect @@ -125,7 +125,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/exporter/otlphttpexporter/go.mod b/exporter/otlphttpexporter/go.mod index 9bb3ac005b5..64da694b52c 100644 --- a/exporter/otlphttpexporter/go.mod +++ b/exporter/otlphttpexporter/go.mod @@ -57,8 +57,8 @@ require ( go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/config/internal v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/extension v0.115.0 // indirect go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect go.opentelemetry.io/collector/extension/experimental/storage v0.115.0 // indirect @@ -123,7 +123,7 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/config/configretry => ../../config/configretry -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/internal/e2e/go.mod b/internal/e2e/go.mod index d6e39c33905..63e30b39a75 100644 --- a/internal/e2e/go.mod +++ b/internal/e2e/go.mod @@ -85,7 +85,7 @@ require ( go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterhelper/exporterhelperprofiles v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/extension/auth v0.115.0 // indirect @@ -190,7 +190,7 @@ replace go.opentelemetry.io/collector/featuregate => ../../featuregate replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/internal/fanoutconsumer/go.mod b/internal/fanoutconsumer/go.mod index 143f2b678bb..2e888282d00 100644 --- a/internal/fanoutconsumer/go.mod +++ b/internal/fanoutconsumer/go.mod @@ -5,8 +5,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/pdata/testdata v0.115.0 @@ -40,4 +40,4 @@ replace go.opentelemetry.io/collector/pdata => ../../pdata replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer diff --git a/internal/fanoutconsumer/profiles.go b/internal/fanoutconsumer/profiles.go index d2a2e25113f..17c6d1dce81 100644 --- a/internal/fanoutconsumer/profiles.go +++ b/internal/fanoutconsumer/profiles.go @@ -9,7 +9,7 @@ import ( "go.uber.org/multierr" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pdata/pprofile" ) @@ -17,7 +17,7 @@ import ( // It fans out the incoming data to all the consumers, and does smart routing: // - Clones only to the consumer that needs to mutate the data. // - If all consumers needs to mutate the data one will get the original mutable data. -func NewProfiles(tcs []consumerprofiles.Profiles) consumerprofiles.Profiles { +func NewProfiles(tcs []xconsumer.Profiles) xconsumer.Profiles { // Don't wrap if there is only one non-mutating consumer. if len(tcs) == 1 && !tcs[0].Capabilities().MutatesData { return tcs[0] @@ -35,8 +35,8 @@ func NewProfiles(tcs []consumerprofiles.Profiles) consumerprofiles.Profiles { } type profilesConsumer struct { - mutable []consumerprofiles.Profiles - readonly []consumerprofiles.Profiles + mutable []xconsumer.Profiles + readonly []xconsumer.Profiles } func (tsc *profilesConsumer) Capabilities() consumer.Capabilities { diff --git a/internal/fanoutconsumer/profiles_test.go b/internal/fanoutconsumer/profiles_test.go index eab0d51bb5f..4402d03e858 100644 --- a/internal/fanoutconsumer/profiles_test.go +++ b/internal/fanoutconsumer/profiles_test.go @@ -12,20 +12,20 @@ import ( "github.com/stretchr/testify/require" "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/testdata" ) func TestProfilesNotMultiplexing(t *testing.T) { nop := consumertest.NewNop() - tfc := NewProfiles([]consumerprofiles.Profiles{nop}) + tfc := NewProfiles([]xconsumer.Profiles{nop}) assert.Same(t, nop, tfc) } func TestProfilesNotMultiplexingMutating(t *testing.T) { p := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} - lfc := NewProfiles([]consumerprofiles.Profiles{p}) + lfc := NewProfiles([]xconsumer.Profiles{p}) assert.True(t, lfc.Capabilities().MutatesData) } @@ -34,7 +34,7 @@ func TestProfilesMultiplexingNonMutating(t *testing.T) { p2 := new(consumertest.ProfilesSink) p3 := new(consumertest.ProfilesSink) - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) assert.False(t, tfc.Capabilities().MutatesData) td := testdata.GenerateProfiles(1) @@ -70,7 +70,7 @@ func TestProfilesMultiplexingMutating(t *testing.T) { p2 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} p3 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) assert.True(t, tfc.Capabilities().MutatesData) td := testdata.GenerateProfiles(1) @@ -107,7 +107,7 @@ func TestReadOnlyProfilesMultiplexingMutating(t *testing.T) { p2 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} p3 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) assert.True(t, tfc.Capabilities().MutatesData) tdOrig := testdata.GenerateProfiles(1) @@ -145,7 +145,7 @@ func TestProfilesMultiplexingMixLastMutating(t *testing.T) { p2 := new(consumertest.ProfilesSink) p3 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) assert.False(t, tfc.Capabilities().MutatesData) td := testdata.GenerateProfiles(1) @@ -183,7 +183,7 @@ func TestProfilesMultiplexingMixLastNonMutating(t *testing.T) { p2 := &mutatingProfilesSink{ProfilesSink: new(consumertest.ProfilesSink)} p3 := new(consumertest.ProfilesSink) - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) assert.False(t, tfc.Capabilities().MutatesData) td := testdata.GenerateProfiles(1) @@ -220,7 +220,7 @@ func TestProfilesWhenErrors(t *testing.T) { p2 := consumertest.NewErr(errors.New("my error")) p3 := new(consumertest.ProfilesSink) - tfc := NewProfiles([]consumerprofiles.Profiles{p1, p2, p3}) + tfc := NewProfiles([]xconsumer.Profiles{p1, p2, p3}) td := testdata.GenerateProfiles(1) for i := 0; i < 2; i++ { diff --git a/otelcol/go.mod b/otelcol/go.mod index 6b6e59e5285..67a01519881 100644 --- a/otelcol/go.mod +++ b/otelcol/go.mod @@ -73,8 +73,8 @@ require ( go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer v1.21.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect go.opentelemetry.io/collector/internal/fanoutconsumer v0.115.0 // indirect @@ -169,7 +169,7 @@ replace go.opentelemetry.io/collector/config/configtls => ../config/configtls replace go.opentelemetry.io/collector/config/configopaque => ../config/configopaque -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/otelcol/otelcoltest/go.mod b/otelcol/otelcoltest/go.mod index a11d3d29ed5..f245a04c684 100644 --- a/otelcol/otelcoltest/go.mod +++ b/otelcol/otelcoltest/go.mod @@ -70,8 +70,8 @@ require ( go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer v1.21.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumertest v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 // indirect go.opentelemetry.io/collector/extension/extensioncapabilities v0.115.0 // indirect go.opentelemetry.io/collector/featuregate v1.21.0 // indirect @@ -166,7 +166,7 @@ replace go.opentelemetry.io/collector/semconv => ../../semconv replace go.opentelemetry.io/collector/extension/experimental/storage => ../../extension/experimental/storage -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/processor/batchprocessor/go.mod b/processor/batchprocessor/go.mod index 897b4c4d83f..4adfedac583 100644 --- a/processor/batchprocessor/go.mod +++ b/processor/batchprocessor/go.mod @@ -41,7 +41,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect @@ -81,7 +81,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/processor/go.mod b/processor/go.mod index d69e314f405..305971ad960 100644 --- a/processor/go.mod +++ b/processor/go.mod @@ -30,7 +30,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect @@ -60,7 +60,7 @@ replace go.opentelemetry.io/collector/pdata/pprofile => ../pdata/pprofile replace go.opentelemetry.io/collector/config/configtelemetry => ../config/configtelemetry -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/processor/memorylimiterprocessor/go.mod b/processor/memorylimiterprocessor/go.mod index d0efed0c4c8..54316a137e9 100644 --- a/processor/memorylimiterprocessor/go.mod +++ b/processor/memorylimiterprocessor/go.mod @@ -49,7 +49,7 @@ require ( github.com/tklauser/numcpus v0.6.1 // indirect github.com/yusufpapurcu/wmi v1.2.4 // indirect go.opentelemetry.io/collector/component/componentstatus v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pdata/testdata v0.115.0 // indirect go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 // indirect @@ -90,7 +90,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/processor/processorhelper/processorhelperprofiles/go.mod b/processor/processorhelper/processorhelperprofiles/go.mod index fc30fef8e9e..7e1b973a208 100644 --- a/processor/processorhelper/processorhelperprofiles/go.mod +++ b/processor/processorhelper/processorhelperprofiles/go.mod @@ -7,8 +7,8 @@ require ( go.opentelemetry.io/collector/component v0.115.0 go.opentelemetry.io/collector/component/componenttest v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/processor v0.115.0 go.opentelemetry.io/collector/processor/processorprofiles v0.115.0 @@ -56,7 +56,7 @@ replace go.opentelemetry.io/collector/processor => ../../../processor replace go.opentelemetry.io/collector/consumer => ../../../consumer -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../../consumer/xconsumer replace go.opentelemetry.io/collector/component => ../../../component diff --git a/processor/processorhelper/processorhelperprofiles/profiles.go b/processor/processorhelper/processorhelperprofiles/profiles.go index de54fe6edd7..afc1da26123 100644 --- a/processor/processorhelper/processorhelperprofiles/profiles.go +++ b/processor/processorhelper/processorhelperprofiles/profiles.go @@ -8,7 +8,7 @@ import ( "errors" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pdata/pprofile" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorhelper" @@ -22,7 +22,7 @@ type ProcessProfilesFunc func(context.Context, pprofile.Profiles) (pprofile.Prof type profiles struct { component.StartFunc component.ShutdownFunc - consumerprofiles.Profiles + xconsumer.Profiles } // NewProfiles creates a processorprofiles.Profiles that ensure context propagation. @@ -30,7 +30,7 @@ func NewProfiles( _ context.Context, _ processor.Settings, _ component.Config, - nextConsumer consumerprofiles.Profiles, + nextConsumer xconsumer.Profiles, profilesFunc ProcessProfilesFunc, options ...Option, ) (processorprofiles.Profiles, error) { @@ -39,7 +39,7 @@ func NewProfiles( } bs := fromOptions(options) - profilesConsumer, err := consumerprofiles.NewProfiles(func(ctx context.Context, pd pprofile.Profiles) (err error) { + profilesConsumer, err := xconsumer.NewProfiles(func(ctx context.Context, pd pprofile.Profiles) (err error) { pd, err = profilesFunc(ctx, pd) if err != nil { if errors.Is(err, processorhelper.ErrSkipProcessingData) { diff --git a/processor/processorprofiles/go.mod b/processor/processorprofiles/go.mod index f33b206fad3..e472c098a9d 100644 --- a/processor/processorprofiles/go.mod +++ b/processor/processorprofiles/go.mod @@ -5,8 +5,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pipeline v0.115.0 go.opentelemetry.io/collector/processor v0.115.0 ) @@ -52,7 +52,7 @@ replace go.opentelemetry.io/collector/component/componenttest => ../../component replace go.opentelemetry.io/collector/pdata => ../../pdata -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/processor/processorprofiles/processor.go b/processor/processorprofiles/processor.go index 7532e98eda3..581babda38a 100644 --- a/processor/processorprofiles/processor.go +++ b/processor/processorprofiles/processor.go @@ -7,7 +7,7 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/processor" ) @@ -22,7 +22,7 @@ type Factory interface { // CreateProfiles creates a Profiles processor based on this config. // If the processor type does not support tracing or if the config is not valid, // an error will be returned instead. - CreateProfiles(ctx context.Context, set processor.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) + CreateProfiles(ctx context.Context, set processor.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) // ProfilesStability gets the stability level of the Profiles processor. ProfilesStability() component.StabilityLevel @@ -31,15 +31,15 @@ type Factory interface { // Profiles is a processor that can consume profiles. type Profiles interface { component.Component - consumerprofiles.Profiles + xconsumer.Profiles } // CreateProfilesFunc is the equivalent of Factory.CreateProfiles(). // CreateProfilesFunc is the equivalent of Factory.CreateProfiles(). -type CreateProfilesFunc func(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) +type CreateProfilesFunc func(context.Context, processor.Settings, component.Config, xconsumer.Profiles) (Profiles, error) // CreateProfiles implements Factory.CreateProfiles. -func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set processor.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) { +func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set processor.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) { if f == nil { return nil, pipeline.ErrSignalNotSupported } diff --git a/processor/processorprofiles/processor_test.go b/processor/processorprofiles/processor_test.go index 1e743e67bfa..e1cf309c931 100644 --- a/processor/processorprofiles/processor_test.go +++ b/processor/processorprofiles/processor_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/processor" ) @@ -42,6 +42,6 @@ type nopProcessor struct { consumertest.Consumer } -func createProfiles(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) { +func createProfiles(context.Context, processor.Settings, component.Config, xconsumer.Profiles) (Profiles, error) { return nopInstance, nil } diff --git a/processor/processortest/go.mod b/processor/processortest/go.mod index 3f54206259d..a874fabb67c 100644 --- a/processor/processortest/go.mod +++ b/processor/processortest/go.mod @@ -9,8 +9,8 @@ require ( go.opentelemetry.io/collector/component/componentstatus v0.115.0 go.opentelemetry.io/collector/component/componenttest v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 go.opentelemetry.io/collector/pdata/testdata v0.115.0 @@ -54,7 +54,7 @@ replace go.opentelemetry.io/collector/component/componentstatus => ../../compone replace go.opentelemetry.io/collector/consumer => ../../consumer -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/processor/processortest/nop_processor.go b/processor/processortest/nop_processor.go index 9a5937e60e5..9f627b40489 100644 --- a/processor/processortest/nop_processor.go +++ b/processor/processortest/nop_processor.go @@ -11,8 +11,8 @@ import ( "go.opentelemetry.io/collector/component" "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/processor" "go.opentelemetry.io/collector/processor/processorprofiles" ) @@ -52,7 +52,7 @@ func createLogs(context.Context, processor.Settings, component.Config, consumer. return nopInstance, nil } -func createProfiles(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (processorprofiles.Profiles, error) { +func createProfiles(context.Context, processor.Settings, component.Config, xconsumer.Profiles) (processorprofiles.Profiles, error) { return nopInstance, nil } diff --git a/receiver/go.mod b/receiver/go.mod index 0140ffdfb9e..47151208bbd 100644 --- a/receiver/go.mod +++ b/receiver/go.mod @@ -35,7 +35,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/receiver/receiverprofiles v0.115.0 // indirect golang.org/x/net v0.29.0 // indirect @@ -61,7 +61,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../config/config replace go.opentelemetry.io/collector/pdata/pprofile => ../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/receiver/nopreceiver/go.mod b/receiver/nopreceiver/go.mod index f0f97e0ddd4..2b2f0bcdb30 100644 --- a/receiver/nopreceiver/go.mod +++ b/receiver/nopreceiver/go.mod @@ -32,7 +32,7 @@ require ( github.com/pmezard/go-difflib v1.0.0 // indirect go.opentelemetry.io/collector/config/configtelemetry v0.115.0 // indirect go.opentelemetry.io/collector/consumer/consumererror v0.115.0 // indirect - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 // indirect + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 // indirect go.opentelemetry.io/collector/pdata v1.21.0 // indirect go.opentelemetry.io/collector/pdata/pprofile v0.115.0 // indirect go.opentelemetry.io/collector/pipeline v0.115.0 // indirect @@ -71,7 +71,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/receiver/otlpreceiver/factory.go b/receiver/otlpreceiver/factory.go index 9ffc0d987f8..b1e53a6c64b 100644 --- a/receiver/otlpreceiver/factory.go +++ b/receiver/otlpreceiver/factory.go @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/internal/sharedcomponent" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/metadata" @@ -132,7 +132,7 @@ func createProfiles( _ context.Context, set receiver.Settings, cfg component.Config, - nextConsumer consumerprofiles.Profiles, + nextConsumer xconsumer.Profiles, ) (receiverprofiles.Profiles, error) { oCfg := cfg.(*Config) r, err := receivers.LoadOrStore( diff --git a/receiver/otlpreceiver/factory_test.go b/receiver/otlpreceiver/factory_test.go index 217fad88ec8..2962013c94a 100644 --- a/receiver/otlpreceiver/factory_test.go +++ b/receiver/otlpreceiver/factory_test.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/config/confignet" "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/internal/testutil" "go.opentelemetry.io/collector/receiver/receiverprofiles" "go.opentelemetry.io/collector/receiver/receivertest" @@ -361,7 +361,7 @@ func TestCreateProfiles(t *testing.T) { cfg *Config wantStartErr bool wantErr bool - sink consumerprofiles.Profiles + sink xconsumer.Profiles }{ { name: "default", diff --git a/receiver/otlpreceiver/go.mod b/receiver/otlpreceiver/go.mod index 6b8a8041220..7757cb7b2cc 100644 --- a/receiver/otlpreceiver/go.mod +++ b/receiver/otlpreceiver/go.mod @@ -18,8 +18,8 @@ require ( go.opentelemetry.io/collector/confmap v1.21.0 go.opentelemetry.io/collector/consumer v1.21.0 go.opentelemetry.io/collector/consumer/consumererror v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/internal/sharedcomponent v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pdata/pprofile v0.115.0 @@ -117,7 +117,7 @@ replace go.opentelemetry.io/collector/consumer => ../../consumer replace go.opentelemetry.io/collector/pdata/pprofile => ../../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../../consumer/consumertest diff --git a/receiver/otlpreceiver/internal/profiles/otlp.go b/receiver/otlpreceiver/internal/profiles/otlp.go index 1b6a5af407c..269769b6824 100644 --- a/receiver/otlpreceiver/internal/profiles/otlp.go +++ b/receiver/otlpreceiver/internal/profiles/otlp.go @@ -6,7 +6,7 @@ package profiles // import "go.opentelemetry.io/collector/receiver/otlpreceiver/ import ( "context" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" "go.opentelemetry.io/collector/receiver/otlpreceiver/internal/errors" ) @@ -14,11 +14,11 @@ import ( // Receiver is the type used to handle spans from OpenTelemetry exporters. type Receiver struct { pprofileotlp.UnimplementedGRPCServer - nextConsumer consumerprofiles.Profiles + nextConsumer xconsumer.Profiles } // New creates a new Receiver reference. -func New(nextConsumer consumerprofiles.Profiles) *Receiver { +func New(nextConsumer xconsumer.Profiles) *Receiver { return &Receiver{ nextConsumer: nextConsumer, } diff --git a/receiver/otlpreceiver/internal/profiles/otlp_test.go b/receiver/otlpreceiver/internal/profiles/otlp_test.go index 7ad26ef4ce3..86fd8f89c26 100644 --- a/receiver/otlpreceiver/internal/profiles/otlp_test.go +++ b/receiver/otlpreceiver/internal/profiles/otlp_test.go @@ -17,8 +17,8 @@ import ( "google.golang.org/grpc/status" "go.opentelemetry.io/collector/consumer/consumererror" - "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" "go.opentelemetry.io/collector/pdata/testdata" ) @@ -67,7 +67,7 @@ func TestExport_PermanentErrorConsumer(t *testing.T) { assert.Equal(t, pprofileotlp.ExportResponse{}, resp) } -func makeProfileServiceClient(t *testing.T, tc consumerprofiles.Profiles) pprofileotlp.GRPCClient { +func makeProfileServiceClient(t *testing.T, tc xconsumer.Profiles) pprofileotlp.GRPCClient { addr := otlpReceiverOnGRPCServer(t, tc) cc, err := grpc.NewClient(addr.String(), grpc.WithTransportCredentials(insecure.NewCredentials())) require.NoError(t, err, "Failed to create the profileServiceClient: %v", err) @@ -78,7 +78,7 @@ func makeProfileServiceClient(t *testing.T, tc consumerprofiles.Profiles) pprofi return pprofileotlp.NewGRPCClient(cc) } -func otlpReceiverOnGRPCServer(t *testing.T, tc consumerprofiles.Profiles) net.Addr { +func otlpReceiverOnGRPCServer(t *testing.T, tc xconsumer.Profiles) net.Addr { ln, err := net.Listen("tcp", "localhost:") require.NoError(t, err, "Failed to find an available address to run the gRPC server: %v", err) diff --git a/receiver/otlpreceiver/otlp.go b/receiver/otlpreceiver/otlp.go index a4c5f08c7a9..0f8d3c66378 100644 --- a/receiver/otlpreceiver/otlp.go +++ b/receiver/otlpreceiver/otlp.go @@ -17,7 +17,7 @@ import ( "go.opentelemetry.io/collector/component/componentstatus" "go.opentelemetry.io/collector/config/confighttp" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pdata/plog/plogotlp" "go.opentelemetry.io/collector/pdata/pmetric/pmetricotlp" "go.opentelemetry.io/collector/pdata/pprofile/pprofileotlp" @@ -39,7 +39,7 @@ type otlpReceiver struct { nextTraces consumer.Traces nextMetrics consumer.Metrics nextLogs consumer.Logs - nextProfiles consumerprofiles.Profiles + nextProfiles xconsumer.Profiles shutdownWG sync.WaitGroup obsrepGRPC *receiverhelper.ObsReport @@ -227,6 +227,6 @@ func (r *otlpReceiver) registerLogsConsumer(lc consumer.Logs) { r.nextLogs = lc } -func (r *otlpReceiver) registerProfilesConsumer(tc consumerprofiles.Profiles) { +func (r *otlpReceiver) registerProfilesConsumer(tc xconsumer.Profiles) { r.nextProfiles = tc } diff --git a/receiver/receiverprofiles/go.mod b/receiver/receiverprofiles/go.mod index cffe7f7eb32..254016b0e7e 100644 --- a/receiver/receiverprofiles/go.mod +++ b/receiver/receiverprofiles/go.mod @@ -5,8 +5,8 @@ go 1.22.0 require ( github.com/stretchr/testify v1.10.0 go.opentelemetry.io/collector/component v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pipeline v0.115.0 go.opentelemetry.io/collector/receiver v0.115.0 ) @@ -44,7 +44,7 @@ replace go.opentelemetry.io/collector/component => ../../component replace go.opentelemetry.io/collector/component/componenttest => ../../component/componenttest -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/configtelemetry diff --git a/receiver/receiverprofiles/profiles.go b/receiver/receiverprofiles/profiles.go index 7308164402f..614dc22b842 100644 --- a/receiver/receiverprofiles/profiles.go +++ b/receiver/receiverprofiles/profiles.go @@ -7,14 +7,14 @@ import ( "context" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver" ) // Profiles receiver receives profiles. // Its purpose is to translate data from any format to the collector's internal profile format. -// Profiles receiver feeds a consumerprofiles.Profiles with data. +// Profiles receiver feeds a xconsumer.Profiles with data. // // For example, it could be a pprof data source which translates pprof profiles into pprofile.Profiles. type Profiles interface { @@ -31,17 +31,17 @@ type Factory interface { // CreateProfiles creates a Profiles based on this config. // If the receiver type does not support tracing or if the config is not valid // an error will be returned instead. `next` is never nil. - CreateProfiles(ctx context.Context, set receiver.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) + CreateProfiles(ctx context.Context, set receiver.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) // ProfilesStability gets the stability level of the Profiles receiver. ProfilesStability() component.StabilityLevel } // CreateProfilesFunc is the equivalent of Factory.CreateProfiles. -type CreateProfilesFunc func(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) +type CreateProfilesFunc func(context.Context, receiver.Settings, component.Config, xconsumer.Profiles) (Profiles, error) // CreateProfiles implements Factory.CreateProfiles. -func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set receiver.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) { +func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set receiver.Settings, cfg component.Config, next xconsumer.Profiles) (Profiles, error) { if f == nil { return nil, pipeline.ErrSignalNotSupported } diff --git a/receiver/receiverprofiles/receiver_test.go b/receiver/receiverprofiles/receiver_test.go index 8182d650eed..b686845b633 100644 --- a/receiver/receiverprofiles/receiver_test.go +++ b/receiver/receiverprofiles/receiver_test.go @@ -10,8 +10,8 @@ import ( "github.com/stretchr/testify/assert" "go.opentelemetry.io/collector/component" - "go.opentelemetry.io/collector/consumer/consumerprofiles" "go.opentelemetry.io/collector/consumer/consumertest" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/receiver" ) @@ -42,6 +42,6 @@ type nopReceiver struct { consumertest.Consumer } -func createProfiles(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (Profiles, error) { +func createProfiles(context.Context, receiver.Settings, component.Config, xconsumer.Profiles) (Profiles, error) { return nopInstance, nil } diff --git a/receiver/receivertest/go.mod b/receiver/receivertest/go.mod index 908b356a1c2..e32c40b0f41 100644 --- a/receiver/receivertest/go.mod +++ b/receiver/receivertest/go.mod @@ -9,8 +9,8 @@ require ( go.opentelemetry.io/collector/component/componenttest v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 go.opentelemetry.io/collector/consumer/consumererror v0.115.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/pdata v1.21.0 go.opentelemetry.io/collector/pipeline v0.115.0 go.opentelemetry.io/collector/receiver v0.115.0 @@ -59,7 +59,7 @@ replace go.opentelemetry.io/collector/config/configtelemetry => ../../config/con replace go.opentelemetry.io/collector/receiver/receiverprofiles => ../receiverprofiles -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumererror => ../../consumer/consumererror diff --git a/receiver/receivertest/nop_receiver.go b/receiver/receivertest/nop_receiver.go index 973c36dffae..74c0ca93fbf 100644 --- a/receiver/receivertest/nop_receiver.go +++ b/receiver/receivertest/nop_receiver.go @@ -11,7 +11,7 @@ import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/component/componenttest" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverprofiles" @@ -73,7 +73,7 @@ func createLogs(context.Context, receiver.Settings, component.Config, consumer.L return nopInstance, nil } -func createProfiles(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (receiverprofiles.Profiles, error) { +func createProfiles(context.Context, receiver.Settings, component.Config, xconsumer.Profiles) (receiverprofiles.Profiles, error) { return nopInstance, nil } diff --git a/service/go.mod b/service/go.mod index 42d5a03eadb..9836cd294fe 100644 --- a/service/go.mod +++ b/service/go.mod @@ -20,8 +20,8 @@ require ( go.opentelemetry.io/collector/connector/connectorprofiles v0.115.0 go.opentelemetry.io/collector/connector/connectortest v0.115.0 go.opentelemetry.io/collector/consumer v1.21.0 - go.opentelemetry.io/collector/consumer/consumerprofiles v0.115.0 go.opentelemetry.io/collector/consumer/consumertest v0.115.0 + go.opentelemetry.io/collector/consumer/xconsumer v0.115.0 go.opentelemetry.io/collector/exporter v0.115.0 go.opentelemetry.io/collector/exporter/exporterprofiles v0.115.0 go.opentelemetry.io/collector/exporter/exportertest v0.115.0 @@ -187,7 +187,7 @@ replace go.opentelemetry.io/collector/config/configcompression => ../config/conf replace go.opentelemetry.io/collector/pdata/pprofile => ../pdata/pprofile -replace go.opentelemetry.io/collector/consumer/consumerprofiles => ../consumer/consumerprofiles +replace go.opentelemetry.io/collector/consumer/xconsumer => ../consumer/xconsumer replace go.opentelemetry.io/collector/consumer/consumertest => ../consumer/consumertest diff --git a/service/internal/builders/connector.go b/service/internal/builders/connector.go index d93a7345f81..9edf0172fd6 100644 --- a/service/internal/builders/connector.go +++ b/service/internal/builders/connector.go @@ -12,7 +12,7 @@ import ( "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/connector/connectortest" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) @@ -90,7 +90,7 @@ func (b *ConnectorBuilder) CreateTracesToLogs(ctx context.Context, set connector } // CreateTracesToProfiles creates a Traces connector based on the settings and config. -func (b *ConnectorBuilder) CreateTracesToProfiles(ctx context.Context, set connector.Settings, next consumerprofiles.Profiles) (connector.Traces, error) { +func (b *ConnectorBuilder) CreateTracesToProfiles(ctx context.Context, set connector.Settings, next xconsumer.Profiles) (connector.Traces, error) { if next == nil { return nil, errNilNextConsumer } @@ -171,7 +171,7 @@ func (b *ConnectorBuilder) CreateMetricsToLogs(ctx context.Context, set connecto } // CreateMetricsToProfiles creates a Metrics connector based on the settings and config. -func (b *ConnectorBuilder) CreateMetricsToProfiles(ctx context.Context, set connector.Settings, next consumerprofiles.Profiles) (connector.Metrics, error) { +func (b *ConnectorBuilder) CreateMetricsToProfiles(ctx context.Context, set connector.Settings, next xconsumer.Profiles) (connector.Metrics, error) { if next == nil { return nil, errNilNextConsumer } @@ -252,7 +252,7 @@ func (b *ConnectorBuilder) CreateLogsToLogs(ctx context.Context, set connector.S } // CreateLogsToProfiles creates a Logs connector based on the settings and config. -func (b *ConnectorBuilder) CreateLogsToProfiles(ctx context.Context, set connector.Settings, next consumerprofiles.Profiles) (connector.Logs, error) { +func (b *ConnectorBuilder) CreateLogsToProfiles(ctx context.Context, set connector.Settings, next xconsumer.Profiles) (connector.Logs, error) { if next == nil { return nil, errNilNextConsumer } @@ -348,7 +348,7 @@ func (b *ConnectorBuilder) CreateProfilesToLogs(ctx context.Context, set connect } // CreateProfilesToProfiles creates a Profiles connector based on the settings and config. -func (b *ConnectorBuilder) CreateProfilesToProfiles(ctx context.Context, set connector.Settings, next consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { +func (b *ConnectorBuilder) CreateProfilesToProfiles(ctx context.Context, set connector.Settings, next xconsumer.Profiles) (connectorprofiles.Profiles, error) { if next == nil { return nil, errNilNextConsumer } diff --git a/service/internal/builders/connector_test.go b/service/internal/builders/connector_test.go index 2dc1d7b108b..7de975e0ca0 100644 --- a/service/internal/builders/connector_test.go +++ b/service/internal/builders/connector_test.go @@ -17,8 +17,8 @@ import ( "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/connector/connectortest" "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/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" ) @@ -57,7 +57,7 @@ func TestConnectorBuilder(t *testing.T) { nextTraces consumer.Traces nextLogs consumer.Logs nextMetrics consumer.Metrics - nextProfiles consumerprofiles.Profiles + nextProfiles xconsumer.Profiles }{ { name: "unknown", @@ -499,7 +499,7 @@ func createConnectorTracesToLogs(context.Context, connector.Settings, component. return nopConnectorInstance, nil } -func createConnectorTracesToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) { +func createConnectorTracesToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Traces, error) { return nopConnectorInstance, nil } @@ -515,7 +515,7 @@ func createConnectorMetricsToLogs(context.Context, connector.Settings, component return nopConnectorInstance, nil } -func createConnectorMetricsToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) { +func createConnectorMetricsToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Metrics, error) { return nopConnectorInstance, nil } @@ -531,7 +531,7 @@ func createConnectorLogsToLogs(context.Context, connector.Settings, component.Co return nopConnectorInstance, nil } -func createConnectorLogsToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) { +func createConnectorLogsToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Logs, error) { return nopConnectorInstance, nil } @@ -547,7 +547,7 @@ func createConnectorProfilesToLogs(context.Context, connector.Settings, componen return nopConnectorInstance, nil } -func createConnectorProfilesToProfiles(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { +func createConnectorProfilesToProfiles(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connectorprofiles.Profiles, error) { return nopConnectorInstance, nil } diff --git a/service/internal/builders/processor.go b/service/internal/builders/processor.go index 890dd96c185..e790a07690f 100644 --- a/service/internal/builders/processor.go +++ b/service/internal/builders/processor.go @@ -9,7 +9,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/pipeline" "go.opentelemetry.io/collector/processor" "go.opentelemetry.io/collector/processor/processorprofiles" @@ -86,7 +86,7 @@ func (b *ProcessorBuilder) CreateLogs(ctx context.Context, set processor.Setting } // CreateProfiles creates a Profiles processor based on the settings and config. -func (b *ProcessorBuilder) CreateProfiles(ctx context.Context, set processor.Settings, next consumerprofiles.Profiles) (processorprofiles.Profiles, error) { +func (b *ProcessorBuilder) CreateProfiles(ctx context.Context, set processor.Settings, next xconsumer.Profiles) (processorprofiles.Profiles, error) { if next == nil { return nil, errNilNextConsumer } diff --git a/service/internal/builders/processor_test.go b/service/internal/builders/processor_test.go index f810f1d2a73..62d3dc37c35 100644 --- a/service/internal/builders/processor_test.go +++ b/service/internal/builders/processor_test.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/component" "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/processor" "go.opentelemetry.io/collector/processor/processorprofiles" "go.opentelemetry.io/collector/processor/processortest" @@ -42,7 +42,7 @@ func TestProcessorBuilder(t *testing.T) { nextTraces consumer.Traces nextLogs consumer.Logs nextMetrics consumer.Metrics - nextProfiles consumerprofiles.Profiles + nextProfiles xconsumer.Profiles }{ { name: "unknown", @@ -237,7 +237,7 @@ func createProcessorLogs(context.Context, processor.Settings, component.Config, return nopProcessorInstance, nil } -func createProcessorProfiles(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (processorprofiles.Profiles, error) { +func createProcessorProfiles(context.Context, processor.Settings, component.Config, xconsumer.Profiles) (processorprofiles.Profiles, error) { return nopProcessorInstance, nil } diff --git a/service/internal/builders/receiver.go b/service/internal/builders/receiver.go index ceb78b8ef3a..45892a15620 100644 --- a/service/internal/builders/receiver.go +++ b/service/internal/builders/receiver.go @@ -9,7 +9,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/pipeline" "go.opentelemetry.io/collector/receiver" "go.opentelemetry.io/collector/receiver/receiverprofiles" @@ -87,7 +87,7 @@ func (b *ReceiverBuilder) CreateLogs(ctx context.Context, set receiver.Settings, } // CreateProfiles creates a Profiles receiver based on the settings and config. -func (b *ReceiverBuilder) CreateProfiles(ctx context.Context, set receiver.Settings, next consumerprofiles.Profiles) (receiverprofiles.Profiles, error) { +func (b *ReceiverBuilder) CreateProfiles(ctx context.Context, set receiver.Settings, next xconsumer.Profiles) (receiverprofiles.Profiles, error) { if next == nil { return nil, errNilNextConsumer } diff --git a/service/internal/builders/receiver_test.go b/service/internal/builders/receiver_test.go index 561aca4eb3a..aa74cbda7ed 100644 --- a/service/internal/builders/receiver_test.go +++ b/service/internal/builders/receiver_test.go @@ -13,8 +13,8 @@ import ( "go.opentelemetry.io/collector/component" "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/receiver" "go.opentelemetry.io/collector/receiver/receiverprofiles" "go.opentelemetry.io/collector/receiver/receivertest" @@ -42,7 +42,7 @@ func TestReceiverBuilder(t *testing.T) { nextTraces consumer.Traces nextLogs consumer.Logs nextMetrics consumer.Metrics - nextProfiles consumerprofiles.Profiles + nextProfiles xconsumer.Profiles }{ { name: "unknown", @@ -245,6 +245,6 @@ func createReceiverLogs(context.Context, receiver.Settings, component.Config, co return nopReceiverInstance, nil } -func createReceiverProfiles(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (receiverprofiles.Profiles, error) { +func createReceiverProfiles(context.Context, receiver.Settings, component.Config, xconsumer.Profiles) (receiverprofiles.Profiles, error) { return nopReceiverInstance, nil } diff --git a/service/internal/capabilityconsumer/capabilities.go b/service/internal/capabilityconsumer/capabilities.go index 734c3151d14..6e867eef54e 100644 --- a/service/internal/capabilityconsumer/capabilities.go +++ b/service/internal/capabilityconsumer/capabilities.go @@ -5,7 +5,7 @@ package capabilityconsumer // import "go.opentelemetry.io/collector/service/inte import ( "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" ) func NewLogs(logs consumer.Logs, capabilities consumer.Capabilities) consumer.Logs { @@ -56,7 +56,7 @@ func (mts capTraces) Capabilities() consumer.Capabilities { return mts.cap } -func NewProfiles(profiles consumerprofiles.Profiles, capabilities consumer.Capabilities) consumerprofiles.Profiles { +func NewProfiles(profiles xconsumer.Profiles, capabilities consumer.Capabilities) xconsumer.Profiles { if profiles.Capabilities() == capabilities { return profiles } @@ -64,7 +64,7 @@ func NewProfiles(profiles consumerprofiles.Profiles, capabilities consumer.Capab } type capProfiles struct { - consumerprofiles.Profiles + xconsumer.Profiles cap consumer.Capabilities } diff --git a/service/internal/graph/capabilities.go b/service/internal/graph/capabilities.go index 8a16ae67853..128e6fde926 100644 --- a/service/internal/graph/capabilities.go +++ b/service/internal/graph/capabilities.go @@ -5,7 +5,7 @@ package graph // import "go.opentelemetry.io/collector/service/internal/graph" import ( "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" ) @@ -25,7 +25,7 @@ type capabilitiesNode struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc - consumerprofiles.ConsumeProfilesFunc + xconsumer.ConsumeProfilesFunc } func newCapabilitiesNode(pipelineID pipeline.ID) *capabilitiesNode { diff --git a/service/internal/graph/connector.go b/service/internal/graph/connector.go index 76e69df77d1..ce965d7417d 100644 --- a/service/internal/graph/connector.go +++ b/service/internal/graph/connector.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/service/internal/builders" @@ -178,9 +178,9 @@ func (n *connectorNode) buildProfiles( builder *builders.ConnectorBuilder, nexts []baseConsumer, ) error { - consumers := make(map[pipeline.ID]consumerprofiles.Profiles, len(nexts)) + consumers := make(map[pipeline.ID]xconsumer.Profiles, len(nexts)) for _, next := range nexts { - consumers[next.(*capabilitiesNode).pipelineID] = next.(consumerprofiles.Profiles) + consumers[next.(*capabilitiesNode).pipelineID] = next.(xconsumer.Profiles) } next := connectorprofiles.NewProfilesRouter(consumers) diff --git a/service/internal/graph/consumer.go b/service/internal/graph/consumer.go index 6bc6b96ca02..2c44a993031 100644 --- a/service/internal/graph/consumer.go +++ b/service/internal/graph/consumer.go @@ -6,7 +6,7 @@ package graph // import "go.opentelemetry.io/collector/service/internal/graph" import ( "go.opentelemetry.io/collector/component" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" ) // baseConsumer redeclared here since not public in consumer package. May consider to make that public. @@ -35,5 +35,5 @@ type componentLogs struct { type componentProfiles struct { component.Component - consumerprofiles.Profiles + xconsumer.Profiles } diff --git a/service/internal/graph/graph.go b/service/internal/graph/graph.go index 76e4d862802..284e7800915 100644 --- a/service/internal/graph/graph.go +++ b/service/internal/graph/graph.go @@ -29,7 +29,7 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/consumer" - "go.opentelemetry.io/collector/consumer/consumerprofiles" + "go.opentelemetry.io/collector/consumer/xconsumer" "go.opentelemetry.io/collector/internal/fanoutconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" @@ -319,7 +319,7 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error { n.baseConsumer = cc n.ConsumeLogsFunc = cc.ConsumeLogs case pipelineprofiles.SignalProfiles: - cc := capabilityconsumer.NewProfiles(next.(consumerprofiles.Profiles), capability) + cc := capabilityconsumer.NewProfiles(next.(xconsumer.Profiles), capability) n.baseConsumer = cc n.ConsumeProfilesFunc = cc.ConsumeProfiles } @@ -345,9 +345,9 @@ func (g *Graph) buildComponents(ctx context.Context, set Settings) error { } n.baseConsumer = fanoutconsumer.NewLogs(consumers) case pipelineprofiles.SignalProfiles: - consumers := make([]consumerprofiles.Profiles, 0, len(nexts)) + consumers := make([]xconsumer.Profiles, 0, len(nexts)) for _, next := range nexts { - consumers = append(consumers, next.(consumerprofiles.Profiles)) + consumers = append(consumers, next.(xconsumer.Profiles)) } n.baseConsumer = fanoutconsumer.NewProfiles(consumers) } diff --git a/service/internal/graph/processor.go b/service/internal/graph/processor.go index 9167152011c..f52316cf958 100644 --- a/service/internal/graph/processor.go +++ b/service/internal/graph/processor.go @@ -9,7 +9,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/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" "go.opentelemetry.io/collector/processor" @@ -59,7 +59,7 @@ func (n *processorNode) buildComponent(ctx context.Context, case pipeline.SignalLogs: n.Component, err = builder.CreateLogs(ctx, set, next.(consumer.Logs)) case pipelineprofiles.SignalProfiles: - n.Component, err = builder.CreateProfiles(ctx, set, next.(consumerprofiles.Profiles)) + n.Component, err = builder.CreateProfiles(ctx, set, next.(xconsumer.Profiles)) default: return fmt.Errorf("error creating processor %q in pipeline %q, data type %q is not supported", set.ID, n.pipelineID.String(), n.pipelineID.Signal()) } diff --git a/service/internal/graph/receiver.go b/service/internal/graph/receiver.go index d5de95ca3b2..3d88d4bfe56 100644 --- a/service/internal/graph/receiver.go +++ b/service/internal/graph/receiver.go @@ -9,7 +9,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/internal/fanoutconsumer" "go.opentelemetry.io/collector/pipeline" "go.opentelemetry.io/collector/pipeline/pipelineprofiles" @@ -66,9 +66,9 @@ func (n *receiverNode) buildComponent(ctx context.Context, } n.Component, err = builder.CreateLogs(ctx, set, fanoutconsumer.NewLogs(consumers)) case pipelineprofiles.SignalProfiles: - var consumers []consumerprofiles.Profiles + var consumers []xconsumer.Profiles for _, next := range nexts { - consumers = append(consumers, next.(consumerprofiles.Profiles)) + consumers = append(consumers, next.(xconsumer.Profiles)) } n.Component, err = builder.CreateProfiles(ctx, set, fanoutconsumer.NewProfiles(consumers)) default: diff --git a/service/internal/graph/util_test.go b/service/internal/graph/util_test.go index dc788bca56a..af5b4f7beae 100644 --- a/service/internal/graph/util_test.go +++ b/service/internal/graph/util_test.go @@ -12,8 +12,8 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "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/exporter" "go.opentelemetry.io/collector/exporter/exporterprofiles" "go.opentelemetry.io/collector/pipeline" @@ -206,7 +206,7 @@ func newErrReceiverFactory() receiver.Factory { receiverprofiles.WithMetrics(func(context.Context, receiver.Settings, component.Config, consumer.Metrics) (receiver.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), - receiverprofiles.WithProfiles(func(context.Context, receiver.Settings, component.Config, consumerprofiles.Profiles) (receiverprofiles.Profiles, error) { + receiverprofiles.WithProfiles(func(context.Context, receiver.Settings, component.Config, xconsumer.Profiles) (receiverprofiles.Profiles, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), ) @@ -224,7 +224,7 @@ func newErrProcessorFactory() processor.Factory { processorprofiles.WithMetrics(func(context.Context, processor.Settings, component.Config, consumer.Metrics) (processor.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), - processorprofiles.WithProfiles(func(context.Context, processor.Settings, component.Config, consumerprofiles.Profiles) (processorprofiles.Profiles, error) { + processorprofiles.WithProfiles(func(context.Context, processor.Settings, component.Config, xconsumer.Profiles) (processorprofiles.Profiles, error) { return &errComponent{}, nil }, component.StabilityLevelUndefined), ) @@ -261,7 +261,7 @@ func newErrConnectorFactory() connector.Factory { connectorprofiles.WithTracesToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Traces, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), - connectorprofiles.WithTracesToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Traces, error) { + connectorprofiles.WithTracesToProfiles(func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Traces, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), @@ -274,7 +274,7 @@ func newErrConnectorFactory() connector.Factory { connectorprofiles.WithMetricsToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), - connectorprofiles.WithMetricsToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Metrics, error) { + connectorprofiles.WithMetricsToProfiles(func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Metrics, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), @@ -287,7 +287,7 @@ func newErrConnectorFactory() connector.Factory { connectorprofiles.WithLogsToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connector.Logs, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), - connectorprofiles.WithLogsToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connector.Logs, error) { + connectorprofiles.WithLogsToProfiles(func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connector.Logs, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), @@ -300,7 +300,7 @@ func newErrConnectorFactory() connector.Factory { connectorprofiles.WithProfilesToLogs(func(context.Context, connector.Settings, component.Config, consumer.Logs) (connectorprofiles.Profiles, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), - connectorprofiles.WithProfilesToProfiles(func(context.Context, connector.Settings, component.Config, consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { + connectorprofiles.WithProfilesToProfiles(func(context.Context, connector.Settings, component.Config, xconsumer.Profiles) (connectorprofiles.Profiles, error) { return &errComponent{}, nil }, component.StabilityLevelUnmaintained), ) diff --git a/service/internal/testcomponents/example_connector.go b/service/internal/testcomponents/example_connector.go index 9ca751f32ee..88e0cf28e0a 100644 --- a/service/internal/testcomponents/example_connector.go +++ b/service/internal/testcomponents/example_connector.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "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" @@ -84,7 +84,7 @@ func createExampleTracesToLogs(_ context.Context, set connector.Settings, _ comp }, nil } -func createExampleTracesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Traces, error) { +func createExampleTracesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles xconsumer.Profiles) (connector.Traces, error) { return &ExampleConnector{ ConsumeTracesFunc: func(ctx context.Context, td ptrace.Traces) error { return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(td.SpanCount())) @@ -118,7 +118,7 @@ func createExampleMetricsToLogs(_ context.Context, set connector.Settings, _ com }, nil } -func createExampleMetricsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Metrics, error) { +func createExampleMetricsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles xconsumer.Profiles) (connector.Metrics, error) { return &ExampleConnector{ ConsumeMetricsFunc: func(ctx context.Context, md pmetric.Metrics) error { return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(md.MetricCount())) @@ -152,7 +152,7 @@ func createExampleLogsToLogs(_ context.Context, set connector.Settings, _ compon }, nil } -func createExampleLogsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connector.Logs, error) { +func createExampleLogsToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles xconsumer.Profiles) (connector.Logs, error) { return &ExampleConnector{ ConsumeLogsFunc: func(ctx context.Context, ld plog.Logs) error { return profiles.ConsumeProfiles(ctx, testdata.GenerateProfiles(ld.LogRecordCount())) @@ -188,7 +188,7 @@ func createExampleProfilesToLogs(_ context.Context, set connector.Settings, _ co }, nil } -func createExampleProfilesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { +func createExampleProfilesToProfiles(_ context.Context, set connector.Settings, _ component.Config, profiles xconsumer.Profiles) (connectorprofiles.Profiles, error) { return &ExampleConnector{ ConsumeProfilesFunc: profiles.ConsumeProfiles, mutatesData: set.ID.Name() == "mutate", @@ -200,7 +200,7 @@ type ExampleConnector struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc - consumerprofiles.ConsumeProfilesFunc + xconsumer.ConsumeProfilesFunc mutatesData bool } diff --git a/service/internal/testcomponents/example_exporter.go b/service/internal/testcomponents/example_exporter.go index 394a7f30762..d22e633d823 100644 --- a/service/internal/testcomponents/example_exporter.go +++ b/service/internal/testcomponents/example_exporter.go @@ -77,7 +77,7 @@ func (exp *ExampleExporter) ConsumeLogs(_ context.Context, ld plog.Logs) error { return nil } -// ConsumeProfiles receives pprofile.Profiles for processing by the consumerprofiles.Profiles. +// ConsumeProfiles receives pprofile.Profiles for processing by the xconsumer.Profiles. func (exp *ExampleExporter) ConsumeProfiles(_ context.Context, td pprofile.Profiles) error { exp.Profiles = append(exp.Profiles, td) return nil diff --git a/service/internal/testcomponents/example_processor.go b/service/internal/testcomponents/example_processor.go index 950c9ed8078..2c074e9dff3 100644 --- a/service/internal/testcomponents/example_processor.go +++ b/service/internal/testcomponents/example_processor.go @@ -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/processor" "go.opentelemetry.io/collector/processor/processorprofiles" ) @@ -51,7 +51,7 @@ func createLogsProcessor(_ context.Context, set processor.Settings, _ component. }, nil } -func createProfilesProcessor(_ context.Context, set processor.Settings, _ component.Config, nextConsumer consumerprofiles.Profiles) (processorprofiles.Profiles, error) { +func createProfilesProcessor(_ context.Context, set processor.Settings, _ component.Config, nextConsumer xconsumer.Profiles) (processorprofiles.Profiles, error) { return &ExampleProcessor{ ConsumeProfilesFunc: nextConsumer.ConsumeProfiles, mutatesData: set.ID.Name() == "mutate", @@ -63,7 +63,7 @@ type ExampleProcessor struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc - consumerprofiles.ConsumeProfilesFunc + xconsumer.ConsumeProfilesFunc mutatesData bool } diff --git a/service/internal/testcomponents/example_receiver.go b/service/internal/testcomponents/example_receiver.go index 2b2af303328..9ed3a24ae4f 100644 --- a/service/internal/testcomponents/example_receiver.go +++ b/service/internal/testcomponents/example_receiver.go @@ -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/receiver" "go.opentelemetry.io/collector/receiver/receiverprofiles" ) @@ -70,7 +70,7 @@ func createProfiles( _ context.Context, _ receiver.Settings, cfg component.Config, - nextConsumer consumerprofiles.Profiles, + nextConsumer xconsumer.Profiles, ) (receiverprofiles.Profiles, error) { tr := createReceiver(cfg) tr.ConsumeProfilesFunc = nextConsumer.ConsumeProfiles @@ -98,7 +98,7 @@ type ExampleReceiver struct { consumer.ConsumeTracesFunc consumer.ConsumeMetricsFunc consumer.ConsumeLogsFunc - consumerprofiles.ConsumeProfilesFunc + xconsumer.ConsumeProfilesFunc } // This is the map of already created example receivers for particular configurations. diff --git a/service/internal/testcomponents/example_router.go b/service/internal/testcomponents/example_router.go index b62cf4d0e11..c2ad20b41a1 100644 --- a/service/internal/testcomponents/example_router.go +++ b/service/internal/testcomponents/example_router.go @@ -10,7 +10,7 @@ import ( "go.opentelemetry.io/collector/connector" "go.opentelemetry.io/collector/connector/connectorprofiles" "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" @@ -79,7 +79,7 @@ func createExampleLogsRouter(_ context.Context, _ connector.Settings, cfg compon }, nil } -func createExampleProfilesRouter(_ context.Context, _ connector.Settings, cfg component.Config, profiles consumerprofiles.Profiles) (connectorprofiles.Profiles, error) { +func createExampleProfilesRouter(_ context.Context, _ connector.Settings, cfg component.Config, profiles xconsumer.Profiles) (connectorprofiles.Profiles, error) { c := cfg.(ExampleRouterConfig) r := profiles.(connectorprofiles.ProfilesRouterAndConsumer) left, _ := r.Consumer(c.Profiles.Left) @@ -105,8 +105,8 @@ type ExampleRouter struct { logsLeft consumer.Logs logsNum int - profilesRight consumerprofiles.Profiles - profilesLeft consumerprofiles.Profiles + profilesRight xconsumer.Profiles + profilesLeft xconsumer.Profiles profilesNum int } diff --git a/service/internal/testcomponents/example_router_test.go b/service/internal/testcomponents/example_router_test.go index 11cdac35a3c..3688ed6aff6 100644 --- a/service/internal/testcomponents/example_router_test.go +++ b/service/internal/testcomponents/example_router_test.go @@ -15,8 +15,8 @@ import ( "go.opentelemetry.io/collector/connector/connectorprofiles" "go.opentelemetry.io/collector/connector/connectortest" "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/testdata" "go.opentelemetry.io/collector/pipeline" ) @@ -161,7 +161,7 @@ func TestProfilesRouter(t *testing.T) { // Many connectors will just call router.ConsumeProfiles, // but some implementation will call RouteProfiles instead. router := connectorprofiles.NewProfilesRouter( - map[pipeline.ID]consumerprofiles.Profiles{ + map[pipeline.ID]xconsumer.Profiles{ leftID: sinkLeft, rightID: sinkRight, }) diff --git a/versions.yaml b/versions.yaml index b9e73ef7c08..f41a9d6b547 100644 --- a/versions.yaml +++ b/versions.yaml @@ -42,7 +42,7 @@ module-sets: - go.opentelemetry.io/collector/connector/connectortest - go.opentelemetry.io/collector/connector/connectorprofiles - go.opentelemetry.io/collector/connector/forwardconnector - - go.opentelemetry.io/collector/consumer/consumerprofiles + - go.opentelemetry.io/collector/consumer/xconsumer - go.opentelemetry.io/collector/consumer/consumererror - go.opentelemetry.io/collector/consumer/consumererror/consumererrorprofiles - go.opentelemetry.io/collector/consumer/consumertest @@ -85,6 +85,7 @@ module-sets: - go.opentelemetry.io/collector/filter excluded-modules: + - go.opentelemetry.io/collector/consumer/consumerprofiles - go.opentelemetry.io/collector/cmd/otelcorecol - go.opentelemetry.io/collector/internal/e2e - go.opentelemetry.io/collector/internal/tools