Skip to content

Commit

Permalink
Remove deprecated funcs Create[*]Exporter and [*]ExporterStability (#…
Browse files Browse the repository at this point in the history
…11662)

Signed-off-by: Bogdan Drutu <[email protected]>
  • Loading branch information
bogdandrutu authored Nov 12, 2024
1 parent 20413ad commit 18090a7
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 64 deletions.
25 changes: 25 additions & 0 deletions .chloggen/rm-dep-exporter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# 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: exporter

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated funcs Create[*]Exporter and [*]ExporterStability

# One or more tracking issues or pull requests related to the change
issues: [11662]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# 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]
48 changes: 0 additions & 48 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,6 @@ type Factory interface {
// TracesStability gets the stability level of the Traces exporter.
TracesStability() component.StabilityLevel

// Deprecated: [v0.112.0] use CreateTraces.
CreateTracesExporter(ctx context.Context, set Settings, cfg component.Config) (Traces, error)

// Deprecated: [v0.112.0] use TracesStability.
TracesExporterStability() component.StabilityLevel

// CreateMetrics creates a Metrics exporter based on this config.
// If the exporter type does not support metrics,
// this function returns the error [pipeline.ErrSignalNotSupported].
Expand All @@ -70,12 +64,6 @@ type Factory interface {
// MetricsStability gets the stability level of the Metrics exporter.
MetricsStability() component.StabilityLevel

// Deprecated: [v0.112.0] use CreateMetrics.
CreateMetricsExporter(ctx context.Context, set Settings, cfg component.Config) (Metrics, error)

// Deprecated: [v0.112.0] use MetricsStability.
MetricsExporterStability() component.StabilityLevel

// CreateLogs creates a Logs exporter based on the config.
// If the exporter type does not support logs,
// this function returns the error [pipeline.ErrSignalNotSupported].
Expand All @@ -84,12 +72,6 @@ type Factory interface {
// LogsStability gets the stability level of the Logs exporter.
LogsStability() component.StabilityLevel

// Deprecated: [v0.112.0] use CreateLogs.
CreateLogsExporter(ctx context.Context, set Settings, cfg component.Config) (Logs, error)

// Deprecated: [v0.112.0] use LogsStability.
LogsExporterStability() component.StabilityLevel

unexportedFactoryFunc()
}

Expand Down Expand Up @@ -119,11 +101,6 @@ func (f CreateTracesFunc) CreateTraces(ctx context.Context, set Settings, cfg co
return f(ctx, set, cfg)
}

// Deprecated: [v0.112.0] use CreateTraces.
func (f CreateTracesFunc) CreateTracesExporter(ctx context.Context, set Settings, cfg component.Config) (Traces, error) {
return f.CreateTraces(ctx, set, cfg)
}

// CreateMetricsFunc is the equivalent of Factory.CreateMetrics.
type CreateMetricsFunc func(context.Context, Settings, component.Config) (Metrics, error)

Expand All @@ -135,11 +112,6 @@ func (f CreateMetricsFunc) CreateMetrics(ctx context.Context, set Settings, cfg
return f(ctx, set, cfg)
}

// Deprecated: [v0.112.0] use CreateMetrics.
func (f CreateMetricsFunc) CreateMetricsExporter(ctx context.Context, set Settings, cfg component.Config) (Metrics, error) {
return f.CreateMetrics(ctx, set, cfg)
}

// CreateLogsFunc is the equivalent of Factory.CreateLogs.
type CreateLogsFunc func(context.Context, Settings, component.Config) (Logs, error)

Expand All @@ -151,11 +123,6 @@ func (f CreateLogsFunc) CreateLogs(ctx context.Context, set Settings, cfg compon
return f(ctx, set, cfg)
}

// Deprecated: [v0.112.0] use CreateLogs.
func (f CreateLogsFunc) CreateLogsExporter(ctx context.Context, set Settings, cfg component.Config) (Logs, error) {
return f.CreateLogs(ctx, set, cfg)
}

type factory struct {
cfgType component.Type
component.CreateDefaultConfigFunc
Expand Down Expand Up @@ -185,21 +152,6 @@ func (f *factory) LogsStability() component.StabilityLevel {
return f.logsStabilityLevel
}

// Deprecated: [v0.112.0] use TracesStability.
func (f *factory) TracesExporterStability() component.StabilityLevel {
return f.tracesStabilityLevel
}

// Deprecated: [v0.112.0] use MetricsStability.
func (f *factory) MetricsExporterStability() component.StabilityLevel {
return f.metricsStabilityLevel
}

// Deprecated: [v0.112.0] use LogsStability.
func (f *factory) LogsExporterStability() component.StabilityLevel {
return f.logsStabilityLevel
}

// WithTraces overrides the default "error not supported" implementation for Factory.CreateTraces and the default "undefined" stability level.
func WithTraces(createTraces CreateTracesFunc, sl component.StabilityLevel) FactoryOption {
return factoryOptionFunc(func(o *factory) {
Expand Down
16 changes: 0 additions & 16 deletions exporter/exporterprofiles/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,6 @@ type Factory interface {

// ProfilesStability gets the stability level of the Profiles exporter.
ProfilesStability() component.StabilityLevel

// Deprecated: [v0.112.0] use CreateProfiles.
CreateProfilesExporter(ctx context.Context, set exporter.Settings, cfg component.Config) (Profiles, error)

// Deprecated: [v0.112.0] use ProfilesExporterStability.
ProfilesExporterStability() component.StabilityLevel
}

// FactoryOption apply changes to ReceiverOptions.
Expand Down Expand Up @@ -65,11 +59,6 @@ func (f CreateProfilesFunc) CreateProfiles(ctx context.Context, set exporter.Set
return f(ctx, set, cfg)
}

// Deprecated: [v0.112.0] use CreateProfiles.
func (f CreateProfilesFunc) CreateProfilesExporter(ctx context.Context, set exporter.Settings, cfg component.Config) (Profiles, error) {
return f.CreateProfiles(ctx, set, cfg)
}

// WithTraces overrides the default "error not supported" implementation for CreateTraces and the default "undefined" stability level.
func WithTraces(createTraces exporter.CreateTracesFunc, sl component.StabilityLevel) FactoryOption {
return factoryOptionFunc(func(o *factoryOpts) {
Expand Down Expand Up @@ -109,11 +98,6 @@ func (f *factory) ProfilesStability() component.StabilityLevel {
return f.profilesStabilityLevel
}

// Deprecated: [v0.112.0] use ProfilesStability.
func (f *factory) ProfilesExporterStability() component.StabilityLevel {
return f.profilesStabilityLevel
}

// NewFactory returns a Factory.
func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory {
opts := factoryOpts{factory: &factory{}}
Expand Down

0 comments on commit 18090a7

Please sign in to comment.