Documentation ¶
Overview ¶
Package spanprocessor contains logic to modify top level settings of a span, such as its name.
Index ¶
- func NewTraceProcessor(nextConsumer consumer.TraceConsumer, config Config) (processor.TraceProcessor, error)
- type Config
- type Factory
- func (f *Factory) CreateDefaultConfig() configmodels.Processor
- func (f *Factory) CreateMetricsProcessor(logger *zap.Logger, nextConsumer consumer.MetricsConsumer, ...) (processor.MetricsProcessor, error)
- func (f *Factory) CreateTraceProcessor(logger *zap.Logger, nextConsumer consumer.TraceConsumer, ...) (processor.TraceProcessor, error)
- func (f *Factory) Type() string
- type Name
- type ToAttributes
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewTraceProcessor ¶
func NewTraceProcessor(nextConsumer consumer.TraceConsumer, config Config) (processor.TraceProcessor, error)
NewTraceProcessor returns the span processor.
Types ¶
type Config ¶
type Config struct { configmodels.ProcessorSettings `mapstructure:",squash"` // Rename specifies the components required to re-name a span. // The `from_attributes` field needs to be set for this processor to be properly // configured. // Note: The field name is `Rename` to avoid collision with the Name() method // from configmodels.ProcessorSettings.NamedEntity Rename Name `mapstructure:"name"` }
Config is the configuration for the span processor.
type Factory ¶
type Factory struct { }
Factory is the factory for the Span 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 metric 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.
type Name ¶
type Name struct { // FromAttributes represents the attribute keys to pull the values from to // generate the new span name. All attribute keys are required in the span // to re-name a span. If any attribute is missing from the span, no re-name // will occur. // Note: The new span name is constructed in order of the `from_attributes` // specified in the configuration. This field is required and cannot be empty. FromAttributes []string `mapstructure:"from_attributes"` // Separator is the string used to separate attributes values in the new // span name. If no value is set, no separator is used between attribute // values. Used with FromAttributes only. Separator string `mapstructure:"separator"` // ToAttributes specifies a configuration to extract attributes from span name. ToAttributes *ToAttributes `mapstructure:"to_attributes"` }
Name specifies the attributes to use to re-name a span.
type ToAttributes ¶ added in v0.2.4
type ToAttributes struct { // Rules is a list of rules to extract attribute values from span name. The values // in the span name are replaced by extracted attribute names. Each rule in the list // is a regex pattern string. Span name is checked against the regex. If it matches // then all named subexpressions of the regex are extracted as attributes // and are added to the span. Each subexpression name becomes an attribute name and // subexpression matched portion becomes the attribute value. The matched portion // in the span name is replaced by extracted attribute name. If the attributes // already exist in the span then they will be overwritten. The process is repeated // for all rules in the order they are specified. Each subsequent rule works on the // span name that is the output after processing the previous rule. Rules []string `mapstructure:"rules"` // BreakAfterMatch specifies if processing of rules should stop after the first // match. If it is false rule processing will continue to be performed over the // modified span name. BreakAfterMatch bool `mapstructure:"break_after_match"` }
Click to show internal directories.
Click to hide internal directories.