tags

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2020 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Delimiter defines character separating category from value in a tag e.g. location:london
	Delimiter = ":"
	// Separator defines character separating tags in a list e.g. os:centos,location:sfo
	Separator = ","

	MAX_TAGS            = 256  //nolint: golint
	MAX_METRIC_NAME_LEN = 4096 //nolint: golint
)

Variables

This section is empty.

Functions

func EncodeMetricStreamTags added in v0.19.2

func EncodeMetricStreamTags(tags Tags) string

EncodeMetricStreamTags encodes Tags into a string suitable for use with stream tags. Tags directly embedded into metric names using the `metric_name|ST[<tags>]` syntax.

func EncodeMetricTags added in v0.19.2

func EncodeMetricTags(tags Tags) []string

EncodeMetricTags encodes Tags into an array of strings. The format check_bundle.metircs.metric.tags needs. This helper is intended to work with legacy check bundle metrics. Tags directly on named metrics are being deprecated in favor of stream tags.

func GetBaseTags added in v0.19.0

func GetBaseTags() []string

GetBaseTags returns the check.tags as a list if check.metric_streamtags is true ensuring that all metrics have, at a minimum, the same base set of tags

func MetricNameWithStreamTags added in v0.19.2

func MetricNameWithStreamTags(metric string, tags Tags) string

MetricNameWithStreamTags will encode tags as stream tags into supplied metric name. Note: if metric name already has stream tags it is assumed the metric name and embedded stream tags are being managed manually and calling this method will nave no effect.

func PrepStreamTags

func PrepStreamTags(tagList string) (string, error)

PrepStreamTags accepts a comma delimited list of key:value pairs and returns a stream tag formatted spec or an error if there are issues with the format of the supplied tag list.

Types

type JSONMetric

type JSONMetric struct {
	Tags  []string    `json:"_tags"`
	Type  string      `json:"_type"`
	Value interface{} `json:"_value"`
}

JSONMetric defines an individual metric received in JSON

type JSONMetrics

type JSONMetrics map[string]JSONMetric

JSONMetrics holds list of JSON metrics received at /write receiver interface

type Tag added in v0.19.0

type Tag = cgm.Tag

Tag aliases cgm's Tag to centralize definition

type TaggedMetric added in v0.19.0

type TaggedMetric struct {
	Tags  *Tags       `json:"_tags"`
	Type  string      `json:"_type"`
	Value interface{} `json:"_value"`
}

TaggedMetric definefs a tagged metric

type TaggedMetrics added in v0.19.0

type TaggedMetrics map[string]TaggedMetric

TaggedMetrics is a list of metrics with tags

type Tags added in v0.19.0

type Tags = cgm.Tags

Tags aliases cgm's Tags to centralize definition

func FromList added in v0.19.0

func FromList(tagList []string) Tags

FromList convert old style list of tags []string{"cat:val","cat:val",...} into a Tags structure

func FromString added in v0.19.0

func FromString(tags string) Tags

FromString convert old style tag string spec "cat:val,cat:val,..." into a Tags structure

Jump to

Keyboard shortcuts

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