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