Documentation ¶
Index ¶
- func MakeFactoryMap(factories ...Factory) (map[component.Type]Factory, error)
- type Builder
- func (b *Builder) CreateLogs(ctx context.Context, set CreateSettings, next consumer.Logs) (Logs, error)
- func (b *Builder) CreateMetrics(ctx context.Context, set CreateSettings, next consumer.Metrics) (Metrics, error)
- func (b *Builder) CreateTraces(ctx context.Context, set CreateSettings, next consumer.Traces) (Traces, error)
- func (b *Builder) Factory(componentType component.Type) component.Factory
- type CreateLogsFunc
- type CreateMetricsFunc
- type CreateSettings
- type CreateTracesFunc
- type Factory
- type FactoryOption
- type Logs
- type Metrics
- type Traces
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Builder ¶
type Builder struct {
// contains filtered or unexported fields
}
Builder processor is a helper struct that given a set of Configs and Factories helps with creating processors.
func NewBuilder ¶
func NewBuilder(cfgs map[component.ID]component.Config, factories map[component.Type]Factory) *Builder
NewBuilder creates a new processor.Builder to help with creating components form a set of configs and factories.
func (*Builder) CreateLogs ¶
func (b *Builder) CreateLogs(ctx context.Context, set CreateSettings, next consumer.Logs) (Logs, error)
CreateLogs creates a Logs processor based on the settings and config.
func (*Builder) CreateMetrics ¶
func (b *Builder) CreateMetrics(ctx context.Context, set CreateSettings, next consumer.Metrics) (Metrics, error)
CreateMetrics creates a Metrics processor based on the settings and config.
func (*Builder) CreateTraces ¶
func (b *Builder) CreateTraces(ctx context.Context, set CreateSettings, next consumer.Traces) (Traces, error)
CreateTraces creates a Traces processor based on the settings and config.
type CreateLogsFunc ¶
type CreateLogsFunc func(context.Context, CreateSettings, component.Config, consumer.Logs) (Logs, error)
CreateLogsFunc is the equivalent of Factory.CreateLogs().
func (CreateLogsFunc) CreateLogsProcessor ¶
func (f CreateLogsFunc) CreateLogsProcessor( ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Logs, ) (Logs, error)
CreateLogsProcessor implements Factory.CreateLogsProcessor().
type CreateMetricsFunc ¶
type CreateMetricsFunc func(context.Context, CreateSettings, component.Config, consumer.Metrics) (Metrics, error)
CreateMetricsFunc is the equivalent of Factory.CreateMetrics().
func (CreateMetricsFunc) CreateMetricsProcessor ¶
func (f CreateMetricsFunc) CreateMetricsProcessor( ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Metrics, ) (Metrics, error)
CreateMetricsProcessor implements Factory.CreateMetricsProcessor().
type CreateSettings ¶
type CreateSettings struct { // ID returns the ID of the component that will be created. ID component.ID component.TelemetrySettings // BuildInfo can be used by components for informational purposes BuildInfo component.BuildInfo }
CreateSettings is passed to Create* functions in Factory.
type CreateTracesFunc ¶
type CreateTracesFunc func(context.Context, CreateSettings, component.Config, consumer.Traces) (Traces, error)
CreateTracesFunc is the equivalent of Factory.CreateTraces().
func (CreateTracesFunc) CreateTracesProcessor ¶
func (f CreateTracesFunc) CreateTracesProcessor( ctx context.Context, set CreateSettings, cfg component.Config, nextConsumer consumer.Traces) (Traces, error)
CreateTracesProcessor implements Factory.CreateTracesProcessor().
type Factory ¶
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 // contains filtered or unexported methods }
Factory is Factory interface for processors.
This interface cannot be directly implemented. Implementations must use the NewProcessorFactory to implement it.
func NewFactory ¶
func NewFactory(cfgType component.Type, createDefaultConfig component.CreateDefaultConfigFunc, options ...FactoryOption) Factory
NewFactory returns a Factory.
type FactoryOption ¶
type FactoryOption interface {
// contains filtered or unexported methods
}
FactoryOption apply changes to Options.
func WithLogs ¶
func WithLogs(createLogs CreateLogsFunc, sl component.StabilityLevel) FactoryOption
WithLogs overrides the default "error not supported" implementation for CreateLogs and the default "undefined" stability level.
func WithMetrics ¶
func WithMetrics(createMetrics CreateMetricsFunc, sl component.StabilityLevel) FactoryOption
WithMetrics overrides the default "error not supported" implementation for CreateMetrics and the default "undefined" stability level.
func WithTraces ¶
func WithTraces(createTraces CreateTracesFunc, sl component.StabilityLevel) FactoryOption
WithTraces overrides the default "error not supported" implementation for CreateTraces and the default "undefined" stability level.