wavefront

package
v1.28.4 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2023 License: MIT Imports: 6 Imported by: 5

README

Wavefront

The wavefront serializer translates the Telegraf metric format to the Wavefront Data Format.

Configuration

[[outputs.file]]
  files = ["stdout"]

  ## Use Strict rules to sanitize metric and tag names from invalid characters
  ## When enabled forward slash (/) and comma (,) will be accepted
  # wavefront_use_strict = false

  ## point tags to use as the source name for Wavefront (if none found, host will be used)
  # wavefront_source_override = ["hostname", "address", "agent_host", "node_host"]

  ## Data format to output.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/influxdata/telegraf/blob/master/docs/DATA_FORMATS_OUTPUT.md
  data_format = "wavefront"
  ## Users who wish their prefix paths to not be converted may set the following:
  ## default behavior (enabled prefix/path conversion):       prod.prefix.name.metric.name
  ## configurable behavior (disabled prefix/path conversion): prod.prefix_name.metric_name
  # wavefront_disable_prefix_conversion = true

Metrics

A Wavefront metric is equivalent to a single field value of a Telegraf measurement. The Wavefront metric name will be: <measurement_name>.<field_name> If a prefix is specified it will be honored. Only boolean and numeric metrics will be serialized, all other types will generate an error.

Example

The following Telegraf metric

cpu,cpu=cpu0,host=testHost user=12,idle=88,system=0 1234567890

will serialize into the following Wavefront metrics

"cpu.user" 12.000000 1234567890 source="testHost" "cpu"="cpu0"
"cpu.idle" 88.000000 1234567890 source="testHost" "cpu"="cpu0"
"cpu.system" 0.000000 1234567890 source="testHost" "cpu"="cpu0"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Sanitize added in v1.25.0

func Sanitize(strict bool, val string) string

Types

type MetricPoint added in v1.24.3

type MetricPoint struct {
	Metric    string
	Value     float64
	Timestamp int64
	Source    string
	Tags      map[string]string
}

type Serializer added in v1.27.0

type Serializer struct {
	Prefix                   string   `toml:"prefix"`
	UseStrict                bool     `toml:"wavefront_use_strict"`
	SourceOverride           []string `toml:"wavefront_source_override"`
	DisablePrefixConversions bool     `toml:"wavefront_disable_prefix_conversion"`
	// contains filtered or unexported fields
}

func (*Serializer) InitFromConfig added in v1.27.0

func (s *Serializer) InitFromConfig(cfg *serializers.Config) error

InitFromConfig is a compatibility function to construct the parser the old way

func (*Serializer) Serialize added in v1.27.0

func (s *Serializer) Serialize(m telegraf.Metric) ([]byte, error)

Serialize : Serialize based on Wavefront format

func (*Serializer) SerializeBatch added in v1.27.0

func (s *Serializer) SerializeBatch(metrics []telegraf.Metric) ([]byte, error)

Jump to

Keyboard shortcuts

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