return error on unsupported serializer data format (#2542)
This commit is contained in:
parent
426182b81a
commit
8514acdc3c
|
@ -81,6 +81,7 @@ be deprecated eventually.
|
|||
- [#2500](https://github.com/influxdata/telegraf/pull/2500): Remove warning if parse empty content
|
||||
- [#2520](https://github.com/influxdata/telegraf/pull/2520): Update default value for Cloudwatch rate limit
|
||||
- [#2513](https://github.com/influxdata/telegraf/issues/2513): create /etc/telegraf/telegraf.d directory in tarball.
|
||||
- [#2541](https://github.com/influxdata/telegraf/issues/2541): Return error on unsupported serializer data format.
|
||||
|
||||
## v1.2.1 [2017-02-01]
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
package serializers
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/influxdata/telegraf"
|
||||
|
||||
"github.com/influxdata/telegraf/plugins/serializers/graphite"
|
||||
|
@ -49,6 +51,8 @@ func NewSerializer(config *Config) (Serializer, error) {
|
|||
serializer, err = NewGraphiteSerializer(config.Prefix, config.Template)
|
||||
case "json":
|
||||
serializer, err = NewJsonSerializer()
|
||||
default:
|
||||
err = fmt.Errorf("Invalid data format: %s", config.DataFormat)
|
||||
}
|
||||
return serializer, err
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue