influxdb/telegraf/plugins/inputs/docker.go

22 lines
473 B
Go
Raw Normal View History

2018-10-05 21:43:01 +00:00
package inputs
import (
"fmt"
)
// Docker is based on telegraf Docker plugin.
type Docker struct {
Endpoint string `json:"endpoint"`
}
// TOML encodes to toml string
func (d *Docker) TOML() string {
return fmt.Sprintf(`[[inputs.docker]]
## Docker Endpoint
## To use TCP, set endpoint = "tcp://[ip]:[port]"
## To use environment variables (ie, docker-machine), set endpoint = "ENV"
## exp: unix:///var/run/docker.sock
endpoint = "%s"
`, d.Endpoint)
}