filter

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MetricWhitelist    = "metricWhitelist"
	MetricBlacklist    = "metricBlacklist"
	MetricTagWhitelist = "metricTagWhitelist"
	MetricTagBlacklist = "metricTagBlacklist"
	TagInclude         = "tagInclude"
	TagExclude         = "tagExclude"
)

Variables

This section is empty.

Functions

func Compile added in v0.9.8

func Compile(filters []string) glob.Glob

func MatchesAllTags added in v1.0.4

func MatchesAllTags(matchers map[string]glob.Glob, tags map[string]string) bool

func MatchesTags added in v1.0.4

func MatchesTags(matchers map[string]glob.Glob, tags map[string]string) bool

func MultiCompile added in v1.0.0

func MultiCompile(filters map[string][]string) map[string]glob.Glob

func MultiSetCompile added in v1.0.4

func MultiSetCompile(filters []map[string][]string) []map[string]glob.Glob

Types

type Config

type Config struct {
	// List of glob pattern strings. Only metrics with names matching this list are reported.
	MetricAllowList []string `yaml:"metricAllowList"`

	// List of glob pattern strings. Metrics with names matching this list are dropped.
	MetricDenyList []string `yaml:"metricDenyList"`

	// List of glob pattern strings. Only metrics containing tag keys matching the list will be reported.
	MetricTagAllowList map[string][]string `yaml:"metricTagAllowList"`

	// List of glob pattern strings. Metrics containing these tag keys will be dropped.
	MetricTagDenyList map[string][]string `yaml:"metricTagDenyList"`

	// List of glob pattern strings. Tags with matching keys will be included. All other tags will be excluded.
	TagInclude []string `yaml:"tagInclude"`

	// List of glob pattern strings. Tags with matching keys will be excluded.
	TagExclude []string `yaml:"tagExclude"`

	// Deprecated: use MetricAllowList instead
	MetricWhitelist []string `yaml:"metricWhitelist"`

	// Deprecated: use MetricDenyList instead
	MetricBlacklist []string `yaml:"metricBlacklist"`

	// Deprecated: use MetricTagAllowList instead
	MetricTagWhitelist map[string][]string `yaml:"metricTagWhitelist"`

	// Deprecated: use MetricTagDenyList instead
	MetricTagBlacklist map[string][]string `yaml:"metricTagBlacklist"`
}

Configuration for filtering metrics. All the filtering options are applied at the end after specified prefixes etc are applied.

func FromQuery

func FromQuery(vals map[string][]string) Config

func (Config) Empty

func (cfg Config) Empty() bool

type Filter

type Filter interface {
	MatchMetric(name string, tags map[string]string) bool
	MatchTag(tagName string) bool
}

func FromConfig added in v1.0.0

func FromConfig(cfg Config) Filter

func NewGlobFilter

func NewGlobFilter(cfg Config) Filter

Jump to

Keyboard shortcuts

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