'discard' output plugin
This commit is contained in:
parent
2b0cd2037b
commit
9db30250c3
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
- [#1564](https://github.com/influxdata/telegraf/issues/1564): Use RFC3339 timestamps in log output.
|
- [#1564](https://github.com/influxdata/telegraf/issues/1564): Use RFC3339 timestamps in log output.
|
||||||
- [#1997](https://github.com/influxdata/telegraf/issues/1997): Non-default HTTP timeouts for RabbitMQ plugin.
|
- [#1997](https://github.com/influxdata/telegraf/issues/1997): Non-default HTTP timeouts for RabbitMQ plugin.
|
||||||
|
- [#2074](https://github.com/influxdata/telegraf/pull/2074): "discard" output plugin added, primarily for testing purposes.
|
||||||
|
|
||||||
### Bugfixes
|
### Bugfixes
|
||||||
|
|
||||||
|
|
|
@ -245,6 +245,7 @@ Telegraf can also collect metrics via the following service plugins:
|
||||||
* [aws kinesis](./plugins/outputs/kinesis)
|
* [aws kinesis](./plugins/outputs/kinesis)
|
||||||
* [aws cloudwatch](./plugins/outputs/cloudwatch)
|
* [aws cloudwatch](./plugins/outputs/cloudwatch)
|
||||||
* [datadog](./plugins/outputs/datadog)
|
* [datadog](./plugins/outputs/datadog)
|
||||||
|
* [discard](./plugins/outputs/discard)
|
||||||
* [file](./plugins/outputs/file)
|
* [file](./plugins/outputs/file)
|
||||||
* [graphite](./plugins/outputs/graphite)
|
* [graphite](./plugins/outputs/graphite)
|
||||||
* [graylog](./plugins/outputs/graylog)
|
* [graylog](./plugins/outputs/graylog)
|
||||||
|
|
|
@ -5,6 +5,7 @@ import (
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/amqp"
|
_ "github.com/influxdata/telegraf/plugins/outputs/amqp"
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch"
|
_ "github.com/influxdata/telegraf/plugins/outputs/cloudwatch"
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/datadog"
|
_ "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/file"
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/graphite"
|
_ "github.com/influxdata/telegraf/plugins/outputs/graphite"
|
||||||
_ "github.com/influxdata/telegraf/plugins/outputs/graylog"
|
_ "github.com/influxdata/telegraf/plugins/outputs/graylog"
|
||||||
|
|
|
@ -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
|
||||||
|
```
|
|
@ -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{} })
|
||||||
|
}
|
Loading…
Reference in New Issue