Documentation ¶
Index ¶
- Variables
- func NewFactory(cfgType config.Type, createDefaultConfig CreateDefaultConfig, ...) component.ProcessorFactory
- func NewLogsProcessor(cfg config.Processor, nextConsumer consumer.Logs, processor LProcessor, ...) (component.LogsProcessor, error)
- func NewMetricsProcessor(cfg config.Processor, nextConsumer consumer.Metrics, processor MProcessor, ...) (component.MetricsProcessor, error)
- func NewTracesProcessor(cfg config.Processor, nextConsumer consumer.Traces, processor TProcessor, ...) (component.TracesProcessor, error)
- type Action
- type ActionKeyValue
- type AttrProc
- type CreateDefaultConfig
- type CreateLogsProcessor
- type CreateMetricsProcessor
- type CreateTracesProcessor
- type FactoryOption
- type LProcessor
- type MProcessor
- type Option
- type Settings
- type TProcessor
Constants ¶
This section is empty.
Variables ¶
var ErrSkipProcessingData = errors.New("sentinel error to skip processing data from the remainder of the pipeline")
ErrSkipProcessingData is a sentinel value to indicate when traces or metrics should intentionally be dropped from further processing in the pipeline because the data is determined to be irrelevant. A processor can return this error to stop further processing without propagating an error back up the pipeline to logs.
Functions ¶
func NewFactory ¶
func NewFactory( cfgType config.Type, createDefaultConfig CreateDefaultConfig, options ...FactoryOption) component.ProcessorFactory
NewFactory returns a component.ProcessorFactory.
func NewLogsProcessor ¶ added in v0.7.0
func NewLogsProcessor( cfg config.Processor, nextConsumer consumer.Logs, 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( cfg config.Processor, nextConsumer consumer.Metrics, 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 NewTracesProcessor ¶ added in v0.25.0
func NewTracesProcessor( cfg config.Processor, nextConsumer consumer.Traces, processor TProcessor, options ...Option, ) (component.TracesProcessor, error)
NewTracesProcessor creates a TracesProcessor that ensure context propagation and the right tags are set. TODO: Add observability metrics support
Types ¶
type Action ¶ added in v0.9.0
type Action string
Action is the enum to capture the four types of actions to perform on an attribute.
const ( // INSERT adds the key/value to attributes when the key does not exist. // No action is applied to attributes where the key already exists. INSERT Action = "insert" // UPDATE updates an existing key with a value. No action is applied // to attributes where the key does not exist. UPDATE Action = "update" // UPSERT performs the INSERT or UPDATE action. The key/value is // insert to attributes that did not originally have the key. The key/value is // updated for attributes where the key already existed. UPSERT Action = "upsert" // DELETE deletes the attribute. If the key doesn't exist, no action is performed. DELETE Action = "delete" // HASH calculates the SHA-1 hash of an existing value and overwrites the // value with it's SHA-1 hash result. HASH Action = "hash" // EXTRACT extracts values using a regular expression rule from the input // 'key' to target keys specified in the 'rule'. If a target key already // exists, it will be overridden. EXTRACT Action = "extract" )
type ActionKeyValue ¶ added in v0.9.0
type ActionKeyValue struct { // Key specifies the attribute to act upon. // This is a required field. Key string `mapstructure:"key"` // Value specifies the value to populate for the key. // The type of the value is inferred from the configuration. Value interface{} `mapstructure:"value"` // A regex pattern must be specified for the action EXTRACT. // It uses the attribute specified by `key' to extract values from // The target keys are inferred based on the names of the matcher groups // provided and the names will be inferred based on the values of the // matcher group. // Note: All subexpressions must have a name. // Note: The value type of the source key must be a string. If it isn't, // no extraction will occur. RegexPattern string `mapstructure:"pattern"` // FromAttribute specifies the attribute to use to populate // the value. If the attribute doesn't exist, no action is performed. FromAttribute string `mapstructure:"from_attribute"` // Action specifies the type of action to perform. // The set of values are {INSERT, UPDATE, UPSERT, DELETE, HASH}. // Both lower case and upper case are supported. // INSERT - Inserts the key/value to attributes when the key does not exist. // No action is applied to attributes where the key already exists. // Either Value or FromAttribute must be set. // UPDATE - Updates an existing key with a value. No action is applied // to attributes where the key does not exist. // Either Value or FromAttribute must be set. // UPSERT - Performs insert or update action depending on the attributes // containing the key. The key/value is insert to attributes // that did not originally have the key. The key/value is updated // for attributes where the key already existed. // Either Value or FromAttribute must be set. // DELETE - Deletes the attribute. If the key doesn't exist, // no action is performed. // HASH - Calculates the SHA-1 hash of an existing value and overwrites the // value with it's SHA-1 hash result. // EXTRACT - Extracts values using a regular expression rule from the input // 'key' to target keys specified in the 'rule'. If a target key // already exists, it will be overridden. // This is a required field. Action Action `mapstructure:"action"` }
ActionKeyValue specifies the attribute key to act upon.
type AttrProc ¶ added in v0.9.0
type AttrProc struct {
// contains filtered or unexported fields
}
AttrProc is an attribute processor.
func NewAttrProc ¶ added in v0.9.0
NewAttrProc validates that the input configuration has all of the required fields for the processor and returns a AttrProc to be used to process attributes. An error is returned if there are any invalid inputs.
func (*AttrProc) Process ¶ added in v0.9.0
func (ap *AttrProc) Process(attrs pdata.AttributeMap)
Process applies the AttrProc to an attribute map.
type CreateDefaultConfig ¶
CreateDefaultConfig is the equivalent of component.ProcessorFactory.CreateDefaultConfig()
type CreateLogsProcessor ¶ added in v0.7.0
type CreateLogsProcessor func(context.Context, component.ProcessorCreateSettings, config.Processor, consumer.Logs) (component.LogsProcessor, error)
CreateLogsProcessor is the equivalent of component.ProcessorFactory.CreateLogsProcessor()
type CreateMetricsProcessor ¶
type CreateMetricsProcessor func(context.Context, component.ProcessorCreateSettings, config.Processor, consumer.Metrics) (component.MetricsProcessor, error)
CreateMetricsProcessor is the equivalent of component.ProcessorFactory.CreateMetricsProcessor()
type CreateTracesProcessor ¶ added in v0.25.0
type CreateTracesProcessor func(context.Context, component.ProcessorCreateSettings, config.Processor, consumer.Traces) (component.TracesProcessor, error)
CreateTracesProcessor is the equivalent of component.ProcessorFactory.CreateTracesProcessor()
type FactoryOption ¶
type FactoryOption func(o *factory)
FactoryOption apply changes to ProcessorOptions.
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(createTracesProcessor CreateTracesProcessor) FactoryOption
WithTraces overrides the default "error not supported" implementation for CreateTracesProcessor.
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 NewTracesProcessor.
type Option ¶ added in v0.7.0
type Option func(*baseSettings)
Option apply changes to internalOptions.
func WithCapabilities ¶ added in v0.7.0
func WithCapabilities(capabilities consumer.Capabilities) Option
WithCapabilities 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 componenthelper.ShutdownFunc) 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 componenthelper.StartFunc) Option
WithStart overrides the default Start function for an processor. The default shutdown function does nothing and always returns nil.
type Settings ¶ added in v0.9.0
type Settings struct { // Actions specifies the list of attributes to act on. // The set of actions are {INSERT, UPDATE, UPSERT, DELETE, HASH, EXTRACT}. // This is a required field. Actions []ActionKeyValue `mapstructure:"actions"` }
Settings specifies the processor settings.
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 TracesProcessor by using NewTracesProcessor.