MCPcopy
hub / github.com/influxdata/telegraf / Parser

Interface Parser

parser.go:6–25  ·  view source on GitHub ↗

Parser is an interface defining functions that a parser plugin must satisfy.

Source from the content-addressed store, hash-verified

4
5// Parser is an interface defining functions that a parser plugin must satisfy.
6type Parser interface {
7 // Parse takes a byte buffer separated by newlines
8 // ie, `cpu.usage.idle 90\ncpu.usage.busy 10`
9 // and parses it into telegraf metrics
10 //
11 // Must be thread-safe.
12 Parse(buf []byte) ([]Metric, error)
13
14 // ParseLine takes a single string metric
15 // ie, "cpu.usage.idle 90"
16 // and parses it into a telegraf metric.
17 //
18 // Must be thread-safe.
19 ParseLine(line string) (Metric, error)
20
21 // SetDefaultTags tells the parser to add all of the given tags
22 // to each parsed metric.
23 // NOTE: do _not_ modify the map after you've passed it here!!
24 SetDefaultTags(tags map[string]string)
25}
26
27// ParserFunc is a function to create a new instance of a parser
28type ParserFunc func() (Parser, error)

Callers 434

mainFunction · 0.65
checkFileFunction · 0.65
mainFunction · 0.65
normalizeURLFunction · 0.65
mainFunction · 0.65
mainFunction · 0.65
ServeHTTPMethod · 0.65
ParseLineMethod · 0.65
InitMethod · 0.65
SetParserMethod · 0.65

Implementers 15

Parserplugins/parsers/collectd/parser.go
Parserplugins/parsers/json_v2/parser.go
Parserplugins/parsers/prometheus/parser.go
Parserplugins/parsers/xpath/parser.go
Parserplugins/parsers/grok/parser.go
Parserplugins/parsers/prometheusremotewrite/
Parserplugins/parsers/opentsdb/parser.go
Parserplugins/parsers/parquet/parser.go
Parserplugins/parsers/influx/parser.go
Parserplugins/parsers/influx/influx_upstream
Parserplugins/parsers/openmetrics/parser.go
Parserplugins/parsers/graphite/parser.go

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…