Add parse_multivalue to collectd parser (#4403)

This commit is contained in:
maxunt
2018-07-11 17:29:23 -07:00
committed by Daniel Nelson
parent 7b73b0db3a
commit 9ebf16636d
5 changed files with 117 additions and 35 deletions

View File

@@ -66,6 +66,9 @@ type Config struct {
// Dataset specification for collectd
CollectdTypesDB []string
// whether to split or join multivalue metrics
CollectdSplit string
// DataType only applies to value, this will be the type to parse value to
DataType string
@@ -109,7 +112,7 @@ func NewParser(config *Config) (Parser, error) {
config.Templates, config.DefaultTags)
case "collectd":
parser, err = NewCollectdParser(config.CollectdAuthFile,
config.CollectdSecurityLevel, config.CollectdTypesDB)
config.CollectdSecurityLevel, config.CollectdTypesDB, config.CollectdSplit)
case "dropwizard":
parser, err = NewDropwizardParser(
config.DropwizardMetricRegistryPath,
@@ -172,8 +175,9 @@ func NewCollectdParser(
authFile string,
securityLevel string,
typesDB []string,
split string,
) (Parser, error) {
return collectd.NewCollectdParser(authFile, securityLevel, typesDB)
return collectd.NewCollectdParser(authFile, securityLevel, typesDB, split)
}
func NewDropwizardParser(