Skip to content

Commit

Permalink
Remove deprecated component [Traces|Metrics|Logs]Processor and Proces…
Browse files Browse the repository at this point in the history
…sorFactory (#6884)

Signed-off-by: Bogdan Drutu <bogdandrutu@gmail.com>
  • Loading branch information
bogdandrutu committed Jan 4, 2023
1 parent 76cf776 commit 2fc6b0e
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 86 deletions.
2 changes: 1 addition & 1 deletion .chloggen/rm-deprecated-processor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ change_type: breaking
component: component

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated ProcessorFactory
note: Remove deprecated ProcessorFactoryOptions

# One or more tracking issues or pull requests related to the change
issues: [6881]
Expand Down
11 changes: 11 additions & 0 deletions .chloggen/rmdepprocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# 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: component

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove deprecated component [Traces|Metrics|Logs]Processor and ProcessorFactory

# One or more tracking issues or pull requests related to the change
issues: [6884]
79 changes: 0 additions & 79 deletions component/processor.go

This file was deleted.

55 changes: 49 additions & 6 deletions processor/processor.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,22 +25,65 @@ import (
)

// Traces is a processor that can consume traces.
type Traces = component.TracesProcessor //nolint:staticcheck
type Traces interface {
component.Component
consumer.Traces
}

// Metrics is a processor that can consume metrics.
type Metrics = component.MetricsProcessor //nolint:staticcheck
type Metrics interface {
component.Component
consumer.Metrics
}

// Logs is a processor that can consume logs.
type Logs = component.LogsProcessor //nolint:staticcheck
type Logs interface {
component.Component
consumer.Logs
}

// CreateSettings is passed to Create* functions in Factory.
type CreateSettings struct {
// ID returns the ID of the component that will be created.
ID component.ID

// CreateSettings is passed to Create* functions in ProcessorFactory.
type CreateSettings = component.ProcessorCreateSettings //nolint:staticcheck
component.TelemetrySettings

// BuildInfo can be used by components for informational purposes
BuildInfo component.BuildInfo
}

// Factory is Factory interface for processors.
//
// This interface cannot be directly implemented. Implementations must
// use the NewProcessorFactory to implement it.
type Factory = component.ProcessorFactory //nolint:staticcheck
type Factory interface {
component.Factory

// CreateTracesProcessor creates a TracesProcessor 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.
CreateTracesProcessor(ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Traces) (Traces, error)

// TracesProcessorStability gets the stability level of the TracesProcessor.
TracesProcessorStability() component.StabilityLevel

// CreateMetricsProcessor creates a MetricsProcessor based on this config.
// If the processor type does not support metrics or if the config is not valid,
// an error will be returned instead.
CreateMetricsProcessor(ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Metrics) (Metrics, error)

// MetricsProcessorStability gets the stability level of the MetricsProcessor.
MetricsProcessorStability() component.StabilityLevel

// CreateLogsProcessor creates a LogsProcessor based on the config.
// If the processor type does not support logs or if the config is not valid,
// an error will be returned instead.
CreateLogsProcessor(ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Logs) (Logs, error)

// LogsProcessorStability gets the stability level of the LogsProcessor.
LogsProcessorStability() component.StabilityLevel
}

// FactoryOption apply changes to Options.
type FactoryOption interface {
Expand Down

0 comments on commit 2fc6b0e

Please sign in to comment.