metricdeconstructor

package
v1.2.23 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrSkipMetric = errors.New("skip metric")

ErrSkipMetric is returned when parsing to indicate skipping

Functions

This section is empty.

Types

type IdentityMetricDeconstructor added in v0.9.0

type IdentityMetricDeconstructor struct {
}

IdentityMetricDeconstructor returns a zero dimension gauge of a metric

func (*IdentityMetricDeconstructor) Parse added in v0.9.0

func (parser *IdentityMetricDeconstructor) Parse(originalMetric string) (string, datapoint.MetricType, map[string]string, error)

Parse returns the zero dimension gauge

type MetricDeconstructor

type MetricDeconstructor interface {
	Parse(originalMetric string) (newMetric string, mtype datapoint.MetricType, dimension map[string]string, err error)
}

MetricDeconstructor is an object that can deconstruct a single metric name into what dimensions it should represent. Useful for compatibility with non dimensioned stores, like graphite

func Load

func Load(name string, options string) (MetricDeconstructor, error)

Load will load a MetricDeconstructor of the given name, with the given options

func LoadJSON added in v0.8.0

func LoadJSON(name string, options map[string]interface{}) (MetricDeconstructor, error)

LoadJSON will load a MetricDeconstructor of the given name, with the given JSON object

type NilDeconstructor added in v1.2.20

type NilDeconstructor struct{}

NilDeconstructor is a parser that always skips a metric

func (*NilDeconstructor) Parse added in v1.2.20

func (m *NilDeconstructor) Parse(originalMetric string) (string, datapoint.MetricType, map[string]string, error)

Parse always returns an error

Jump to

Keyboard shortcuts

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