Add configurable separator graphite serializer and output (#7545)
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
|
||||
type Graphite struct {
|
||||
GraphiteTagSupport bool
|
||||
GraphiteSeparator string
|
||||
// URL is only for backwards compatibility
|
||||
Servers []string
|
||||
Prefix string
|
||||
@@ -41,6 +42,9 @@ var sampleConfig = `
|
||||
## Enable Graphite tags support
|
||||
# graphite_tag_support = false
|
||||
|
||||
## Character for separating metric name and field for Graphite tags
|
||||
# graphite_separator = "."
|
||||
|
||||
## Graphite templates patterns
|
||||
## 1. Template for cpu
|
||||
## 2. Template for disk*
|
||||
@@ -145,7 +149,7 @@ func checkEOF(conn net.Conn) {
|
||||
func (g *Graphite) Write(metrics []telegraf.Metric) error {
|
||||
// Prepare data
|
||||
var batch []byte
|
||||
s, err := serializers.NewGraphiteSerializer(g.Prefix, g.Template, g.GraphiteTagSupport, g.Templates)
|
||||
s, err := serializers.NewGraphiteSerializer(g.Prefix, g.Template, g.GraphiteTagSupport, g.GraphiteSeparator, g.Templates)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user