filter

package
v0.0.0-...-1d907cd Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2024 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"
	TagGuaranteeList   = "tagGuaranteeList"
)

Variables

This section is empty.

Functions

func Compile

func Compile(filters []string) glob.Glob

func MatchesAllTags

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

func MatchesTags

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

func MultiCompile

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

func MultiSetCompile

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"`

	// List of tags guaranteed to not be removed during kubernetes metrics collection. Supersedes all other collection filters. These tags are given priority if you hit the 20 tag limit.
	TagGuaranteeList []string `yaml:"tagGuaranteeList"`

	// 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
	GetTagGuaranteeList() []string
}

func FromConfig

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