diff --git a/plugins/outputs/all/all.go b/plugins/outputs/all/all.go index 28354e7e45ad9..96091b2ade894 100644 --- a/plugins/outputs/all/all.go +++ b/plugins/outputs/all/all.go @@ -5,6 +5,7 @@ import ( _ "github.com/influxdata/telegraf/plugins/outputs/amqp" _ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch" _ "github.com/influxdata/telegraf/plugins/outputs/datadog" + _ "github.com/influxdata/telegraf/plugins/outputs/discard" _ "github.com/influxdata/telegraf/plugins/outputs/file" _ "github.com/influxdata/telegraf/plugins/outputs/graphite" _ "github.com/influxdata/telegraf/plugins/outputs/graylog" diff --git a/plugins/outputs/discard/README.md b/plugins/outputs/discard/README.md new file mode 100644 index 0000000000000..e1c70b742450a --- /dev/null +++ b/plugins/outputs/discard/README.md @@ -0,0 +1,12 @@ +# discard Output Plugin + +This output plugin simply drops all metrics that are sent to it. It is only +meant to be used for testing purposes. + +### Configuration: + +```toml +# Send metrics to nowhere at all +[[outputs.discard]] + # no configuration +``` diff --git a/plugins/outputs/discard/discard.go b/plugins/outputs/discard/discard.go new file mode 100644 index 0000000000000..4a6d634b70656 --- /dev/null +++ b/plugins/outputs/discard/discard.go @@ -0,0 +1,18 @@ +package discard + +import ( + "github.com/influxdata/telegraf" + "github.com/influxdata/telegraf/plugins/outputs" +) + +type Discard struct{} + +func (d *Discard) Connect() error { return nil } +func (d *Discard) Close() error { return nil } +func (d *Discard) SampleConfig() string { return "" } +func (d *Discard) Description() string { return "Send metrics to nowhere at all" } +func (d *Discard) Write(metrics []telegraf.Metric) error { return nil } + +func init() { + outputs.Add("discard", func() telegraf.Output { return &Discard{} }) +}