filtermetric

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package filtermetric is a helper package for processing metrics.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchProperties

type MatchProperties struct {
	// MatchConfig configures the matching patterns used when matching metric properties.
	filterset.Config `mapstructure:",squash"`

	// MetricNames specifies the list of string patterns to match metric names against.
	// A match occurs if the metric name matches at least one string pattern in this list.
	MetricNames []string `mapstructure:"metric_names"`
}

MatchProperties specifies the set of properties in a metric to match against and the type of string pattern matching to use.

type Matcher

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

Matcher matches metrics by metric properties against prespecified values for each property.

func NewMatcher

func NewMatcher(config *MatchProperties) (Matcher, error)

NewMatcher constructs a metric Matcher that can be used to match metrics by metric properties. For each supported metric property, the Matcher accepts a set of prespecified values. An incoming metric matches on a property if the property matches at least one of the prespecified values. A metric only matches if every metric property configured on the Matcher is a match.

The metric Matcher supports matching by the following metric properties: - Metric name

func (*Matcher) MatchMetric

func (m *Matcher) MatchMetric(metric *metricspb.Metric) bool

MatchMetric matches a metric using the metric properties configured on the Matcher. A metric only matches if every metric property configured on the Matcher is a match.

Jump to

Keyboard shortcuts

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