processorhelper

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 11, 2020 License: Apache-2.0 Imports: 10 Imported by: 108

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFactory

func NewFactory(
	cfgType configmodels.Type,
	createDefaultConfig CreateDefaultConfig,
	options ...FactoryOption) component.ProcessorFactory

NewFactory returns a component.ProcessorFactory.

func NewLogsProcessor added in v0.7.0

func NewLogsProcessor(
	config configmodels.Processor,
	nextConsumer consumer.LogsConsumer,
	processor LProcessor,
	options ...Option,
) (component.LogsProcessor, error)

NewLogsProcessor creates a LogsProcessor that ensure context propagation and the right tags are set. TODO: Add observability metrics support

func NewMetricsProcessor added in v0.7.0

func NewMetricsProcessor(
	config configmodels.Processor,
	nextConsumer consumer.MetricsConsumer,
	processor MProcessor,
	options ...Option,
) (component.MetricsProcessor, error)

NewMetricsProcessor creates a MetricsProcessor that ensure context propagation and the right tags are set. TODO: Add observability metrics support

func NewTraceProcessor added in v0.7.0

func NewTraceProcessor(
	config configmodels.Processor,
	nextConsumer consumer.TraceConsumer,
	processor TProcessor,
	options ...Option,
) (component.TraceProcessor, error)

NewTraceProcessor creates a TraceProcessor that ensure context propagation and the right tags are set. TODO: Add observability metrics support

Types

type CreateDefaultConfig

type CreateDefaultConfig func() configmodels.Processor

CreateDefaultConfig is the equivalent of component.ProcessorFactory.CreateDefaultConfig()

type CreateLogsProcessor added in v0.7.0

CreateLogsProcessor is the equivalent of component.ProcessorFactory.CreateLogsProcessor()

type CreateMetricsProcessor

CreateMetricsProcessor is the equivalent of component.ProcessorFactory.CreateMetricsProcessor()

type CreateTraceProcessor

CreateTraceProcessor is the equivalent of component.ProcessorFactory.CreateTraceProcessor()

type FactoryOption

type FactoryOption func(o *factory)

FactoryOption apply changes to ProcessorOptions.

func WithCustomUnmarshaler added in v0.8.0

func WithCustomUnmarshaler(customUnmarshaler component.CustomUnmarshaler) FactoryOption

WithCustomUnmarshaler implements component.ConfigUnmarshaler.

func WithLogs

func WithLogs(createLogsProcessor CreateLogsProcessor) FactoryOption

WithLogs overrides the default "error not supported" implementation for CreateLogsProcessor.

func WithMetrics

func WithMetrics(createMetricsProcessor CreateMetricsProcessor) FactoryOption

WithMetrics overrides the default "error not supported" implementation for CreateMetricsProcessor.

func WithTraces

func WithTraces(createTraceProcessor CreateTraceProcessor) FactoryOption

WithTraces overrides the default "error not supported" implementation for CreateTraceProcessor.

type LProcessor added in v0.7.0

type LProcessor interface {
	// ProcessLogs is a helper function that processes the incoming data and returns the data to be sent to the next component.
	// If error is returned then returned data are ignored. It MUST not call the next component.
	ProcessLogs(context.Context, pdata.Logs) (pdata.Logs, error)
}

LProcessor is a helper interface that allows avoiding implementing all functions in LogsProcessor by using NewLogsProcessor.

type MProcessor added in v0.7.0

type MProcessor interface {
	// ProcessMetrics is a helper function that processes the incoming data and returns the data to be sent to the next component.
	// If error is returned then returned data are ignored. It MUST not call the next component.
	ProcessMetrics(context.Context, pdata.Metrics) (pdata.Metrics, error)
}

MProcessor is a helper interface that allows avoiding implementing all functions in MetricsProcessor by using NewTraceProcessor.

type Option added in v0.7.0

type Option func(*baseProcessor)

Option apply changes to internalOptions.

func WithCapabilities added in v0.7.0

func WithCapabilities(capabilities component.ProcessorCapabilities) Option

WithShutdown overrides the default GetCapabilities function for an processor. The default GetCapabilities function returns mutable capabilities.

func WithShutdown added in v0.7.0

func WithShutdown(shutdown Shutdown) Option

WithShutdown overrides the default Shutdown function for an processor. The default shutdown function does nothing and always returns nil.

func WithStart added in v0.7.0

func WithStart(start Start) Option

WithStart overrides the default Start function for an processor. The default shutdown function does nothing and always returns nil.

type Shutdown added in v0.7.0

type Shutdown func(context.Context) error

Shutdown specifies the function invoked when the processor is being shutdown.

type Start added in v0.7.0

type Start func(context.Context, component.Host) error

Start specifies the function invoked when the processor is being started.

type TProcessor added in v0.7.0

type TProcessor interface {
	// ProcessTraces is a helper function that processes the incoming data and returns the data to be sent to the next component.
	// If error is returned then returned data are ignored. It MUST not call the next component.
	ProcessTraces(context.Context, pdata.Traces) (pdata.Traces, error)
}

TProcessor is a helper interface that allows avoiding implementing all functions in TraceProcessor by using NewTraceProcessor.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL