attributekeyprocessor

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTraceProcessor

func NewTraceProcessor(nextConsumer consumer.TraceConsumer, replacements ...KeyReplacement) (processor.TraceProcessor, error)

NewTraceProcessor returns a processor.TraceProcessor

Types

type Config

type Config struct {
	configmodels.ProcessorSettings `mapstructure:",squash"`
	// map key is the attribute key to be replaced.
	Keys map[string]NewKeyProperties `mapstructure:"keys"`
}

Config defines configuration for Attribute Key processor.

type Factory

type Factory struct {
}

Factory is the factory for Attribute Key processor.

func (*Factory) CreateDefaultConfig

func (f *Factory) CreateDefaultConfig() configmodels.Processor

CreateDefaultConfig creates the default configuration for processor.

func (*Factory) CreateMetricsProcessor

func (f *Factory) CreateMetricsProcessor(
	logger *zap.Logger,
	nextConsumer consumer.MetricsConsumer,
	cfg configmodels.Processor,
) (processor.MetricsProcessor, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (*Factory) CreateTraceProcessor

func (f *Factory) CreateTraceProcessor(
	logger *zap.Logger,
	nextConsumer consumer.TraceConsumer,
	cfg configmodels.Processor,
) (processor.TraceProcessor, error)

CreateTraceProcessor creates a trace processor based on this config.

func (*Factory) Type

func (f *Factory) Type() string

Type gets the type of the config created by this factory.

type KeyReplacement

type KeyReplacement struct {
	// Key the attribute key to be replaced.
	Key string `mapstructure:"key"`
	// NewKey is the value that will be used as the new key for the attribute.
	NewKey string `mapstructure:"replacement"`
	// Overwrite is set to true to indicate that the replacement should be
	// performed even if the new key already exists on the attributes.
	// In this case the original value associated with the new key is lost.
	Overwrite bool `mapstructure:"overwrite"`
	// KeepOriginal is set to true to indicate that the original key
	// should not be removed from the attributes.
	KeepOriginal bool `mapstructure:"keep"`
}

KeyReplacement identifies a key and its respective replacement.

type NewKeyProperties

type NewKeyProperties struct {
	// NewKey is the value that will be used as the new key for the attribute.
	NewKey string `mapstructure:"replacement"`
	// Overwrite is set to true to indicate that the replacement should be
	// performed even if the new key already exists on the attributes.
	// In this case the original value associated with the new key is lost.
	Overwrite bool `mapstructure:"overwrite"`
	// KeepOriginal is set to true to indicate that the original key
	// should not be removed from the attributes.
	KeepOriginal bool `mapstructure:"keep"`
}

NewKeyProperties defines the key's replacments properties.

Jump to

Keyboard shortcuts

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