graphite

package
v0.0.17 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2021 License: MIT Imports: 10 Imported by: 0

README

Graphite

The Graphite data format translates graphite dot buckets directly into circonus stream names, with a single value field, and without any tags. By default, the separator is left as ., but this can be changed using the separator argument. For more advanced options, the agent supports specifying templates to translate graphite buckets into metrics.

Configuration
[[inputs.exec]]
  ## Commands array
  commands = ["/tmp/test.sh", "/usr/bin/mycollector --foo=bar"]

  ## measurement name suffix (for separating different commands)
  name_suffix = "_mycollector"

  ## Data format to consume.
  ## Each data format has its own unique set of configuration options, read
  ## more about them here:
  ## https://github.com/circonus-labs/circonus-unified-agent/blob/master/docs/DATA_FORMATS_INPUT.md
  data_format = "graphite"

  ## This string will be used to join the matched values.
  separator = "_"

  ## Each template line requires a template pattern. It can have an optional
  ## filter before the template and separated by spaces. It can also have optional extra
  ## tags following the template. Multiple tags should be separated by commas and no spaces
  ## similar to the line protocol format. There can be only one default template.
  ## Templates support below format:
  ## 1. filter + template
  ## 2. filter + template + extra tag(s)
  ## 3. filter + template with field key
  ## 4. default template
  templates = [
    "*.app env.service.resource.measurement",
    "stats.* .host.measurement* region=eu-east,agent=sensu",
    "stats2.* .host.measurement.field",
    "measurement*"
  ]
templates

Consult the Template Patterns documentation for details.

Documentation

Index

Constants

View Source
const (
	// DefaultSeparator is the default join character to use when joining multiple
	// measurement parts in a template.
	DefaultSeparator = "."
)

Variables

View Source
var (
	MinDate = time.Date(1901, 12, 13, 0, 0, 0, 0, time.UTC)
	MaxDate = time.Date(2038, 1, 19, 0, 0, 0, 0, time.UTC)
)

Minimum and maximum supported dates for timestamps.

Functions

This section is empty.

Types

type Config

type Config struct {
	Separator string
	Templates []string
}

Config represents the configuration for Graphite endpoints.

func (*Config) Validate

func (c *Config) Validate() error

Validate validates the config's templates and tags.

type Parser added in v0.0.12

type Parser struct {
	Separator   string
	Templates   []string
	DefaultTags map[string]string
	// contains filtered or unexported fields
}

Parser encapsulates a Graphite Parser.

func NewGraphiteParser

func NewGraphiteParser(
	separator string,
	templates []string,
	defaultTags map[string]string,
) (*Parser, error)

func (*Parser) ApplyTemplate added in v0.0.12

func (p *Parser) ApplyTemplate(line string) (string, map[string]string, string, error)

ApplyTemplate extracts the template fields from the given line and returns the measurement name and tags.

func (*Parser) Parse added in v0.0.12

func (p *Parser) Parse(buf []byte) ([]cua.Metric, error)

func (*Parser) ParseLine added in v0.0.12

func (p *Parser) ParseLine(line string) (cua.Metric, error)

Parse performs Graphite parsing of a single line.

func (*Parser) SetDefaultTags added in v0.0.12

func (p *Parser) SetDefaultTags(tags map[string]string)

Jump to

Keyboard shortcuts

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