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 ¶
func NewFactory ¶
NewFactory returns a new factory for the Filter processor.
Types ¶
type Config ¶
type Config struct { // ErrorMode determines how the processor reacts to errors that occur while processing an OTTL condition. // Valid values are `ignore` and `propagate`. // `ignore` means the processor ignores errors returned by conditions and continues on to the next condition. This is the recommended mode. // `propagate` means the processor returns the error up the pipeline. This will result in the payload being dropped from the collector. // The default value is `propagate`. ErrorMode ottl.ErrorMode `mapstructure:"error_mode"` Metrics MetricFilters `mapstructure:"metrics"` Logs LogFilters `mapstructure:"logs"` Spans filterconfig.MatchConfig `mapstructure:"spans"` Traces TraceFilters `mapstructure:"traces"` }
Config defines configuration for Resource processor.
type LogFilters ¶
type LogFilters struct { // Include match properties describe logs that should be included in the Collector Service pipeline, // all other logs should be dropped from further processing. // If both Include and Exclude are specified, Include filtering occurs first. Include *LogMatchProperties `mapstructure:"include"` // Exclude match properties describe logs that should be excluded from the Collector Service pipeline, // all other logs should be included. // If both Include and Exclude are specified, Include filtering occurs first. Exclude *LogMatchProperties `mapstructure:"exclude"` // LogConditions is a list of OTTL conditions for an ottllog context. // If any condition resolves to true, the log event will be dropped. // Supports `and`, `or`, and `()` LogConditions []string `mapstructure:"log_record"` }
LogFilters filters by Log properties.
type LogMatchProperties ¶ added in v0.36.0
type LogMatchProperties struct { // LogMatchType specifies the type of matching desired LogMatchType LogMatchType `mapstructure:"match_type"` // ResourceAttributes defines a list of possible resource attributes to match logs against. // A match occurs if any resource attribute matches all expressions in this given list. ResourceAttributes []filterconfig.Attribute `mapstructure:"resource_attributes"` // RecordAttributes defines a list of possible record attributes to match logs against. // A match occurs if any record attribute matches at least one expression in this given list. RecordAttributes []filterconfig.Attribute `mapstructure:"record_attributes"` // SeverityTexts is a list of strings that the LogRecord's severity text field must match // against. SeverityTexts []string `mapstructure:"severity_texts"` // SeverityNumberProperties defines how to match against a log record's SeverityNumber, if defined. SeverityNumberProperties *LogSeverityNumberMatchProperties `mapstructure:"severity_number"` // LogBodies is a list of strings that the LogRecord's body field must match // against. LogBodies []string `mapstructure:"bodies"` }
LogMatchProperties specifies the set of properties in a log to match against and the type of string pattern matching to use.
type LogMatchType ¶ added in v0.36.0
type LogMatchType string
LogMatchType specifies the strategy for matching against `plog.Log`s.
type LogSeverityNumberMatchProperties ¶ added in v0.58.0
type LogSeverityNumberMatchProperties struct { // Min is the minimum severity needed for the log record to match. // This corresponds to the short names specified here: // https://github.com/open-telemetry/opentelemetry-specification/blob/main/specification/logs/data-model.md#displaying-severity // this field is case-insensitive ("INFO" == "info") Min logSeverity `mapstructure:"min"` // MatchUndefined lets logs records with "unknown" severity match. // If MinSeverity is not set, this field is ignored, as fields are not matched based on severity. MatchUndefined bool `mapstructure:"match_undefined"` }
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 *filterconfig.MetricMatchProperties `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 *filterconfig.MetricMatchProperties `mapstructure:"exclude"` // RegexpConfig specifies options for the regexp match type RegexpConfig *regexp.Config `mapstructure:"regexp"` // MetricConditions is a list of OTTL conditions for an ottlmetric context. // If any condition resolves to true, the metric will be dropped. // Supports `and`, `or`, and `()` MetricConditions []string `mapstructure:"metric"` // DataPointConditions is a list of OTTL conditions for an ottldatapoint context. // If any condition resolves to true, the datapoint will be dropped. // Supports `and`, `or`, and `()` DataPointConditions []string `mapstructure:"datapoint"` }
MetricFilters filters by Metric properties.
type TraceFilters ¶ added in v0.65.0
type TraceFilters struct { // SpanConditions is a list of OTTL conditions for an ottlspan context. // If any condition resolves to true, the span will be dropped. // Supports `and`, `or`, and `()` SpanConditions []string `mapstructure:"span"` // SpanEventConditions is a list of OTTL conditions for an ottlspanevent context. // If any condition resolves to true, the span event will be dropped. // Supports `and`, `or`, and `()` SpanEventConditions []string `mapstructure:"spanevent"` }
TraceFilters filters by OTTL conditions
Source Files
¶
Click to show internal directories.
Click to hide internal directories.