Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecated funcs from processor package #11368

Merged
merged 1 commit into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .chloggen/rm-dep-processor.yaml
Original file line number Diff line number Diff line change
@@ -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]
62 changes: 7 additions & 55 deletions processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,60 +54,42 @@ 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)

// 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)
}

Expand All @@ -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
}

Expand All @@ -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)

Expand All @@ -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)

Expand All @@ -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) {
Expand Down Expand Up @@ -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
}
Expand Down
3 changes: 0 additions & 3 deletions processor/processorhelper/logs.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,3 @@ func NewLogs(
Logs: logsConsumer,
}, nil
}

// Deprecated: [v0.111.0] use NewTraces.
var NewLogsProcessor = NewLogs
3 changes: 0 additions & 3 deletions processor/processorhelper/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,3 @@ func NewMetrics(
Metrics: metricsConsumer,
}, nil
}

// Deprecated: [v0.111.0] use NewMetrics.
var NewMetricsProcessor = NewMetrics
3 changes: 0 additions & 3 deletions processor/processorhelper/traces.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,3 @@ func NewTraces(
Traces: traceConsumer,
}, nil
}

// Deprecated: [v0.111.0] use NewTraces.
var NewTracesProcessor = NewTraces
8 changes: 0 additions & 8 deletions processor/processorprofiles/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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.
Expand Down
Loading