dropwizard

package
v0.0.0-...-bdb06d8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2018 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parser

type Parser struct {

	// an optional json path containing the metric registry object
	// if left empty, the whole json object is parsed as a metric registry
	MetricRegistryPath string

	// an optional json path containing the default time of the metrics
	// if left empty, or if cannot be parsed the current processing time is used as the time of the metrics
	TimePath string

	// time format to use for parsing the time field
	// defaults to time.RFC3339
	TimeFormat string

	// an optional json path pointing to a json object with tag key/value pairs
	// takes precedence over TagPathsMap
	TagsPath string

	// an optional map containing tag names as keys and json paths to retrieve the tag values from as values
	// used if TagsPath is empty or doesn't return any tags
	TagPathsMap map[string]string

	// an optional map of default tags to use for metrics
	DefaultTags map[string]string

	// templating configuration
	Separator string
	Templates []string
	// contains filtered or unexported fields
}

Parser parses json inputs containing dropwizard metrics, either top-level or embedded inside a json field. This parser is using gjon for retrieving paths within the json file.

func (*Parser) InitTemplating

func (p *Parser) InitTemplating() error

InitTemplating initializes the templating support

func (*Parser) Parse

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

Parse parses the input bytes to an array of metrics

func (*Parser) ParseLine

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

ParseLine is not supported by the dropwizard format

func (*Parser) SetDefaultTags

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

SetDefaultTags sets the default tags

Jump to

Keyboard shortcuts

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