filter

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByAttribute

func ByAttribute[T any](config AttributeFamilyConfig, getters attributes.NamedGetters[T, string]) pipe.MiddleProvider[[]T, []T]

ByAttribute provides a pipeline node that drops all the records of type T (*ebpf.Record, or *request.Span) that do not match the provided AttributeFamilyConfig.

Types

type AttributeFamilyConfig

type AttributeFamilyConfig map[string]MatchDefinition

AttributeFamilyConfig maps, for a given record, each attribute with its MatchDefinition

type AttributesConfig

type AttributesConfig struct {
	Application AttributeFamilyConfig `yaml:"application"`
	Network     AttributeFamilyConfig `yaml:"network"`
}

AttributesConfig stores the user-provided section for filtering either Application or Network records by attribute values

type MatchDefinition

type MatchDefinition struct {
	// Match stores the glob that a given attribute must match to let the record pass
	Match string `yaml:"match"`
	// NotMatch stores the glob that a given attribute MUST NOT match to let the record pass
	NotMatch string `yaml:"not_match"`
}

MatchDefinition stores the user-provided definition for the record filtering.

func (*MatchDefinition) Validate

func (md *MatchDefinition) Validate() error

type Matcher

type Matcher[T any] struct {
	// Glob will be compared with the value of the field
	Glob glob.Glob
	// Negate the condition value
	Negate bool
	// Getter for the field to be compared with the Glob
	Getter attributes.Getter[T, string]
}

Matcher condition for a given field of the record type T.

func (*Matcher[T]) Matches

func (m *Matcher[T]) Matches(record T) bool

Jump to

Keyboard shortcuts

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