filters

package
v3.0.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2018 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package filters has logic describing the filtering of unwanted metrics. Filters are configured from the agent configuration file and is intended to be passed into each monitor for use if it sends datapoints on its own.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicFilter

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

BasicFilter is an exclusionary filter that is designed to filter SignalFx datapoint objects. It can filter based on the monitor type, dimensions, or the metric name. It supports both static, globbed, and regex patterns for filter values. If dimensions are specifed, they must all match for the datapoint to match. If multiple metric names are given, only one must match for the datapoint to match the filter since datapoints can only have one metric name.

func New

func New(monitorType string, metricNames []string, dimensions map[string]string, negated bool) *BasicFilter

New returns a new filter with the given configuration

func (*BasicFilter) Matches

func (f *BasicFilter) Matches(dp *datapoint.Datapoint) bool

Matches tests a datapoint to see whether it is excluded by this filter. In order to match on monitor type, the datapoint should have the "monitorType" key set in it's Meta field.

type Filter

type Filter interface {
	// Matches takes a datapoint and returns whether it is matched by the
	// filter
	Matches(*datapoint.Datapoint) bool
}

Filter describes any datapoint filter

type FilterSet

type FilterSet struct {
	Filters []Filter
}

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

func (*FilterSet) Matches

func (fs *FilterSet) Matches(dp *datapoint.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.

Jump to

Keyboard shortcuts

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