From 8e000eae83e0a281dbbedf5a6d703c8b637d5ec0 Mon Sep 17 00:00:00 2001 From: Bogdan Drutu Date: Mon, 7 Oct 2024 09:36:18 -0700 Subject: [PATCH] Remove deprecated funcs from processor package (#11368) Signed-off-by: Bogdan Drutu --- .chloggen/rm-dep-processor.yaml | 20 ++++++++ processor/processor.go | 62 +++--------------------- processor/processorhelper/logs.go | 3 -- processor/processorhelper/metrics.go | 3 -- processor/processorhelper/traces.go | 3 -- processor/processorprofiles/processor.go | 8 --- 6 files changed, 27 insertions(+), 72 deletions(-) create mode 100644 .chloggen/rm-dep-processor.yaml diff --git a/.chloggen/rm-dep-processor.yaml b/.chloggen/rm-dep-processor.yaml new file mode 100644 index 00000000000..4a36b20ebcb --- /dev/null +++ b/.chloggen/rm-dep-processor.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: breaking + +# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver) +component: processor + +# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`). +note: Remove deprecated funcs from processor package + +# One or more tracking issues or pull requests related to the change +issues: [11368] + +# 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/processor/processor.go b/processor/processor.go index ea12c98f0b4..8ecd4d497c6 100644 --- a/processor/processor.go +++ b/processor/processor.go @@ -54,52 +54,34 @@ type Factory interface { // Implementers can assume `next` is never nil. CreateTraces(ctx context.Context, set Settings, cfg component.Config, next consumer.Traces) (Traces, error) - // Deprecated: [v0.111.0] use CreateTraces. - CreateTracesProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Traces) (Traces, error) - // TracesStability gets the stability level of the Traces processor. TracesStability() component.StabilityLevel - // Deprecated: [v0.111.0] use TracesStability. - TracesProcessorStability() component.StabilityLevel - // CreateMetrics creates a Metrics processor based on this config. // If the processor type does not support metrics, // this function returns the error [pipeline.ErrSignalNotSupported]. // Implementers can assume `next` is never nil. CreateMetrics(ctx context.Context, set Settings, cfg component.Config, next consumer.Metrics) (Metrics, error) - // Deprecated: [v0.111.0] use CreateMetrics. - CreateMetricsProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Metrics) (Metrics, error) - // MetricsStability gets the stability level of the Metrics processor. MetricsStability() component.StabilityLevel - // Deprecated: [v0.111.0] use MetricsStability. - MetricsProcessorStability() component.StabilityLevel - // CreateLogs creates a Logs processor based on the config. // If the processor type does not support logs, // this function returns the error [pipeline.ErrSignalNotSupported]. // Implementers can assume `next` is never nil. CreateLogs(ctx context.Context, set Settings, cfg component.Config, next consumer.Logs) (Logs, error) - // Deprecated: [v0.111.0] use CreateLogs. - CreateLogsProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Logs) (Logs, error) - // LogsStability gets the stability level of the Logs processor. LogsStability() component.StabilityLevel - // Deprecated: [v0.111.0] use LogsStability. - LogsProcessorStability() component.StabilityLevel - unexportedFactoryFunc() } // FactoryOption apply changes to Options. type FactoryOption interface { - // applyProcessorFactoryOption applies the option. - applyProcessorFactoryOption(o *factory) + // applyOption applies the option. + applyOption(o *factory) } var _ FactoryOption = (*factoryOptionFunc)(nil) @@ -107,7 +89,7 @@ var _ FactoryOption = (*factoryOptionFunc)(nil) // factoryOptionFunc is a FactoryOption created through a function. type factoryOptionFunc func(*factory) -func (f factoryOptionFunc) applyProcessorFactoryOption(o *factory) { +func (f factoryOptionFunc) applyOption(o *factory) { f(o) } @@ -128,30 +110,15 @@ func (f *factory) Type() component.Type { func (f *factory) unexportedFactoryFunc() {} -func (f factory) TracesStability() component.StabilityLevel { +func (f *factory) TracesStability() component.StabilityLevel { return f.tracesStabilityLevel } -// Deprecated: [v0.111.0] use TracesStability. -func (f factory) TracesProcessorStability() component.StabilityLevel { - return f.tracesStabilityLevel -} - -func (f factory) MetricsStability() component.StabilityLevel { +func (f *factory) MetricsStability() component.StabilityLevel { return f.metricsStabilityLevel } -// Deprecated: [v0.111.0] use MetricsStability. -func (f factory) MetricsProcessorStability() component.StabilityLevel { - return f.tracesStabilityLevel -} - -func (f factory) LogsStability() component.StabilityLevel { - return f.logsStabilityLevel -} - -// Deprecated: [v0.111.0] use LogsStability. -func (f factory) LogsProcessorStability() component.StabilityLevel { +func (f *factory) LogsStability() component.StabilityLevel { return f.logsStabilityLevel } @@ -166,11 +133,6 @@ func (f CreateTracesFunc) CreateTraces(ctx context.Context, set Settings, cfg co return f(ctx, set, cfg, next) } -// Deprecated: [v0.111.0] use CreateTraces. -func (f CreateTracesFunc) CreateTracesProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Traces) (Traces, error) { - return f.CreateTraces(ctx, set, cfg, next) -} - // CreateMetricsFunc is the equivalent of Factory.CreateMetrics(). type CreateMetricsFunc func(context.Context, Settings, component.Config, consumer.Metrics) (Metrics, error) @@ -182,11 +144,6 @@ func (f CreateMetricsFunc) CreateMetrics(ctx context.Context, set Settings, cfg return f(ctx, set, cfg, next) } -// Deprecated: [v0.111.0] use CreateMetrics. -func (f CreateMetricsFunc) CreateMetricsProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Metrics) (Metrics, error) { - return f.CreateMetrics(ctx, set, cfg, next) -} - // CreateLogsFunc is the equivalent of Factory.CreateLogs. type CreateLogsFunc func(context.Context, Settings, component.Config, consumer.Logs) (Logs, error) @@ -198,11 +155,6 @@ func (f CreateLogsFunc) CreateLogs(ctx context.Context, set Settings, cfg compon return f(ctx, set, cfg, next) } -// Deprecated: [v0.111.0] use CreateLogs. -func (f CreateLogsFunc) CreateLogsProcessor(ctx context.Context, set Settings, cfg component.Config, next consumer.Logs) (Logs, error) { - return f.CreateLogs(ctx, set, cfg, next) -} - // WithTraces overrides the default "error not supported" implementation for CreateTraces and the default "undefined" stability level. func WithTraces(createTraces CreateTracesFunc, sl component.StabilityLevel) FactoryOption { return factoryOptionFunc(func(o *factory) { @@ -234,7 +186,7 @@ func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefa CreateDefaultConfigFunc: createDefaultConfig, } for _, opt := range options { - opt.applyProcessorFactoryOption(f) + opt.applyOption(f) } return f } diff --git a/processor/processorhelper/logs.go b/processor/processorhelper/logs.go index 5fedd5dfaf0..23c702cd2a3 100644 --- a/processor/processorhelper/logs.go +++ b/processor/processorhelper/logs.go @@ -75,6 +75,3 @@ func NewLogs( Logs: logsConsumer, }, nil } - -// Deprecated: [v0.111.0] use NewTraces. -var NewLogsProcessor = NewLogs diff --git a/processor/processorhelper/metrics.go b/processor/processorhelper/metrics.go index bf69e1b1693..0bd32553335 100644 --- a/processor/processorhelper/metrics.go +++ b/processor/processorhelper/metrics.go @@ -75,6 +75,3 @@ func NewMetrics( Metrics: metricsConsumer, }, nil } - -// Deprecated: [v0.111.0] use NewMetrics. -var NewMetricsProcessor = NewMetrics diff --git a/processor/processorhelper/traces.go b/processor/processorhelper/traces.go index 3cebc3ab9b9..941168985a2 100644 --- a/processor/processorhelper/traces.go +++ b/processor/processorhelper/traces.go @@ -76,6 +76,3 @@ func NewTraces( Traces: traceConsumer, }, nil } - -// Deprecated: [v0.111.0] use NewTraces. -var NewTracesProcessor = NewTraces diff --git a/processor/processorprofiles/processor.go b/processor/processorprofiles/processor.go index a79147c4d95..7532e98eda3 100644 --- a/processor/processorprofiles/processor.go +++ b/processor/processorprofiles/processor.go @@ -24,9 +24,6 @@ type Factory interface { // an error will be returned instead. CreateProfiles(ctx context.Context, set processor.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) - // Deprecated: [v0.111.0] use CreateProfiles. - CreateProfilesProcessor(ctx context.Context, set processor.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) - // ProfilesStability gets the stability level of the Profiles processor. ProfilesStability() component.StabilityLevel } @@ -49,11 +46,6 @@ func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set processor.Se return f(ctx, set, cfg, next) } -// Deprecated: [v0.111.0] use CreateProfiles. -func (f CreateProfilesFunc) CreateProfilesProcessor(ctx context.Context, set processor.Settings, cfg component.Config, next consumerprofiles.Profiles) (Profiles, error) { - return f.CreateProfiles(ctx, set, cfg, next) -} - // FactoryOption apply changes to ReceiverOptions. type FactoryOption interface { // applyOption applies the option.