filterprocessor

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

README

Filter Processor

Supported pipeline types: metrics

The filter processor can be configured to include or exclude metrics based on metric name. Please refer to config.go for the config spec.

It takes a pipeline type, of which only metrics is supported, followed by an action:

  • include: Any names NOT matching filters are excluded from remainder of pipeline
  • exclude: Any names matching filters are excluded from remainder of pipeline

For the actions the following parameters are required:

  • match_type: strict|regexp
  • metric_names: list of strings or re2 regex patterns

More details can found at include/exclude metrics.

Examples:

processors:
  filter/1:
    metrics:
      include:
        match_type: regexp
        metric_names:
        - prefix/.*
        - prefix_.*
      exclude:
        match_type: strict
        metric_names:
        - hello_world
        - hello/world

Refer to config.yaml for detailed examples on using the processor.

Documentation

Overview

Package filterprocessor implements a processor for filtering (dropping) metrics and/or spans by various properties.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	configmodels.ProcessorSettings `mapstructure:",squash"`
	Metrics                        MetricFilters `mapstructure:"metrics"`
}

Config defines configuration for Resource processor.

type Factory

type Factory struct {
}

Factory is the factory for filter 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.MetricsConsumerOld,
	cfg configmodels.Processor,
) (component.MetricsProcessorOld, error)

CreateMetricsProcessor creates a metrics processor based on this config.

func (Factory) CreateTraceProcessor

func (f Factory) CreateTraceProcessor(
	logger *zap.Logger,
	nextConsumer consumer.TraceConsumerOld,
	c configmodels.Processor,
) (component.TraceProcessorOld, error)

CreateTraceProcessor creates a trace processor based on this config.

func (Factory) Type

func (f Factory) Type() configmodels.Type

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

type MetricFilters

type MetricFilters struct {
	// Include match properties describe metrics that should be included in the Collector Service pipeline,
	// all other metrics should be dropped from further processing.
	// If both Include and Exclude are specified, Include filtering occurs first.
	Include *filtermetric.MatchProperties `mapstructure:"include"`

	// Exclude match properties describe metrics that should be excluded from the Collector Service pipeline,
	// all other metrics should be included.
	// If both Include and Exclude are specified, Include filtering occurs first.
	Exclude *filtermetric.MatchProperties `mapstructure:"exclude"`
}

MetricFilter filters by Metric properties.

Jump to

Keyboard shortcuts

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