dpfilters

package
v0.106.1 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FilterSet

type FilterSet struct {
	// contains filtered or unexported fields
}

FilterSet is a collection of datapont filters, any one of which must match for a datapoint to be matched.

func NewFilterSet

func NewFilterSet(excludes []MetricFilter, includes []MetricFilter) (*FilterSet, error)

func (*FilterSet) Matches

func (fs *FilterSet) Matches(dp *sfxpb.DataPoint) bool

Matches sends a datapoint through each of the filters in the set and returns true if at least one of them matches the datapoint.

type MetricFilter

type MetricFilter struct {
	Dimensions  map[string]any `mapstructure:"dimensions"`
	MetricName  string         `mapstructure:"metric_name"`
	MetricNames []string       `mapstructure:"metric_names"`
}

type StringFilter

type StringFilter struct {
	// contains filtered or unexported fields
}

StringFilter will match if any one of the given strings is a match.

func NewStringFilter

func NewStringFilter(items []string) (*StringFilter, error)

NewStringFilter returns a filter that can match against the provided items.

func (*StringFilter) Matches

func (f *StringFilter) Matches(s string) bool

Matches if s is positively matched by the filter items OR if it is positively matched by a non-glob/regex pattern exactly and is negated as well. See the unit tests for examples.

func (*StringFilter) UnmarshalText

func (f *StringFilter) UnmarshalText(in []byte) error

Jump to

Keyboard shortcuts

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