|
|
@@ -0,0 +1,213 @@
|
|
|
+# Supported tags and respective `Dockerfile` links
|
|
|
+
|
|
|
+- [`0.12`, `0.12.0`, `latest` (*0.12/Dockerfile*)](https://github.com/influxdata/telegraf-docker/blob/bd8563caf622eab7a2e429aa7bf809465337ead5/0.12/Dockerfile)
|
|
|
+
|
|
|
+[](https://imagelayers.io/?images=telegraf:0.12)
|
|
|
+
|
|
|
+For more information about this image and its history, please see [the relevant manifest file (`library/telegraf`)](https://github.com/docker-library/official-images/blob/master/library/telegraf). This image is updated via [pull requests to the `docker-library/official-images` GitHub repo](https://github.com/docker-library/official-images/pulls?q=label%3Alibrary%2Ftelegraf).
|
|
|
+
|
|
|
+For detailed information about the virtual/transfer sizes and individual layers of each of the above supported tags, please see [the `telegraf/tag-details.md` file](https://github.com/docker-library/docs/blob/master/telegraf/tag-details.md) in [the `docker-library/docs` GitHub repo](https://github.com/docker-library/docs).
|
|
|
+
|
|
|
+# Telegraf
|
|
|
+
|
|
|
+Telegraf is an open source agent written in Go for collecting metrics and data on the system it's running on or from other services. Telegraf writes data it collects to InfluxDB in the correct format.
|
|
|
+
|
|
|
+[Telegraf Official Docs](https://docs.influxdata.com/telegraf/latest/introduction/getting-started-telegraf/)
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+## Using this image
|
|
|
+
|
|
|
+### Exposed Ports
|
|
|
+
|
|
|
+- 8125 StatsD
|
|
|
+- 8092 UDP
|
|
|
+- 8094 TCP
|
|
|
+
|
|
|
+### Using the default configuration
|
|
|
+
|
|
|
+The default configuration requires a running InfluxDB instance as an output plugin. Ensure that InfluxDB is running on port 8086 before starting the Telegraf container.
|
|
|
+
|
|
|
+Minimal example to start an InfluxDB container:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name influxdb -p 8083:8083 -p 8086:8086 influxdb
|
|
|
+```
|
|
|
+
|
|
|
+Starting Telegraf using the default config, which connects to InfluxDB at `http://localhost:8086/`:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run --net=container:influxdb telegraf
|
|
|
+```
|
|
|
+
|
|
|
+### Using a custom config file
|
|
|
+
|
|
|
+First, generate a sample configuration and save it as `telegraf.conf` on the host:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run --rm telegraf -sample-config > telegraf.conf
|
|
|
+```
|
|
|
+
|
|
|
+Once you've customized `telegraf.conf`, you can run the Telegraf container with it mounted in the expected location:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -v /path/to/telegraf.conf:/etc/telegraf/telegraf.conf:ro telegraf
|
|
|
+```
|
|
|
+
|
|
|
+Read more about the Telegraf configuration [here](https://docs.influxdata.com/telegraf/latest/introduction/configuration/).
|
|
|
+
|
|
|
+### Using the container with input plugins
|
|
|
+
|
|
|
+These examples assume you are using a custom configuration file that takes advantage of Docker's built-in service discovery capability. In order to do so, we'll first create a new network:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker network create telegraf_nw
|
|
|
+```
|
|
|
+
|
|
|
+Next, we'll start our InfluxDB container named `influxdb`:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name influxdb \
|
|
|
+ --net=telegraf_nw \
|
|
|
+ -p 8083:8083 -p 8086:8086 \
|
|
|
+ influxdb
|
|
|
+```
|
|
|
+
|
|
|
+The `telegraf.conf` configuration can now resolve the `influxdb` container by name:
|
|
|
+
|
|
|
+```toml
|
|
|
+[[outputs.influxdb]]
|
|
|
+ urls = ["http://influxdb:8086"]
|
|
|
+```
|
|
|
+
|
|
|
+Finally, we start our Telegraf container and verify functionality:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name telegraf \
|
|
|
+ --net=telegraf_nw \
|
|
|
+ -v /path/to/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
|
|
|
+ telegraf
|
|
|
+...
|
|
|
+$ docker logs -f telegraf
|
|
|
+```
|
|
|
+
|
|
|
+#### Aerospike
|
|
|
+
|
|
|
+Start an instance of aerospike:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name aerospike \
|
|
|
+ --net=telegraf_nw \
|
|
|
+ -p 3000-3003:3000-3003 \
|
|
|
+ aerospike
|
|
|
+```
|
|
|
+
|
|
|
+Edit your Telegraf config file and set the correct connection parameter for Aerospike:
|
|
|
+
|
|
|
+```toml
|
|
|
+[[inputs.aerospike]]
|
|
|
+ servers = ["aerospike:3000"]
|
|
|
+```
|
|
|
+
|
|
|
+Restart your `telegraf` container to pick up the changes:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker restart telegraf
|
|
|
+```
|
|
|
+
|
|
|
+#### Nginx
|
|
|
+
|
|
|
+Create an `nginx_status.conf` configuration file to expose metric data:
|
|
|
+
|
|
|
+```nginx
|
|
|
+server {
|
|
|
+ listen 8090;
|
|
|
+ location /nginx_status {
|
|
|
+ stub_status on;
|
|
|
+ access_log on;
|
|
|
+ }
|
|
|
+}
|
|
|
+```
|
|
|
+
|
|
|
+Start an Nginx container utilizing it:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name=nginx \
|
|
|
+ --net=telegraf_nw \
|
|
|
+ -p 8090:8090 -p 8080:80 \
|
|
|
+ -v /path/to/nginx_status.conf:/etc/nginx/conf.d/nginx_status.conf:ro \
|
|
|
+ nginx
|
|
|
+```
|
|
|
+
|
|
|
+Verify the status page: [http://localhost:8090/nginx_status](http://localhost:8090/nginx_status).
|
|
|
+
|
|
|
+Configure the nginx input plugin in your Telegraf configuration file:
|
|
|
+
|
|
|
+```toml
|
|
|
+[[inputs.nginx]]
|
|
|
+ urls = ["http://nginx:8090/nginx_status"]
|
|
|
+```
|
|
|
+
|
|
|
+Restart your `telegraf` container to pick up the changes:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker restart telegraf
|
|
|
+```
|
|
|
+
|
|
|
+#### StatsD
|
|
|
+
|
|
|
+Telegraf has a StatsD plugin, allowing Telegraf to run as a StatsD server that metrics can be sent to. In order for this to work, you must first configure the [StatsD plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/statsd) in your config file.
|
|
|
+
|
|
|
+Run Telegraf with the UDP port 8125 exposed:
|
|
|
+
|
|
|
+```console
|
|
|
+$ docker run -d --name telegraf \
|
|
|
+ --net=telegraf_nw \
|
|
|
+ -p 8125:8125/udp \
|
|
|
+ -v /path/to/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
|
|
|
+ telegraf
|
|
|
+```
|
|
|
+
|
|
|
+Send Mock StatsD data:
|
|
|
+
|
|
|
+```console
|
|
|
+$ for i in {1..50}; do echo $i;echo "foo:1|c" | nc -u -w0 127.0.0.1 8125; done
|
|
|
+```
|
|
|
+
|
|
|
+Check that the measurement `foo` is added in the DB.
|
|
|
+
|
|
|
+### Supported Plugins Reference
|
|
|
+
|
|
|
+- [Input Plugins](https://docs.influxdata.com/telegraf/latest/outputs/)
|
|
|
+
|
|
|
+- [Output Plugins](https://docs.influxdata.com/telegraf/latest/outputs/)
|
|
|
+
|
|
|
+# License
|
|
|
+
|
|
|
+View [license information](https://github.com/influxdata/telegraf/blob/master/LICENSE) for the software contained in this image.
|
|
|
+
|
|
|
+# Supported Docker versions
|
|
|
+
|
|
|
+This image is officially supported on Docker version 1.11.1.
|
|
|
+
|
|
|
+Support for older versions (down to 1.6) is provided on a best-effort basis.
|
|
|
+
|
|
|
+Please see [the Docker installation documentation](https://docs.docker.com/installation/) for details on how to upgrade your Docker daemon.
|
|
|
+
|
|
|
+# User Feedback
|
|
|
+
|
|
|
+## Documentation
|
|
|
+
|
|
|
+Documentation for this image is stored in the [`telegraf/` directory](https://github.com/docker-library/docs/tree/master/telegraf) of the [`docker-library/docs` GitHub repo](https://github.com/docker-library/docs). Be sure to familiarize yourself with the [repository's `README.md` file](https://github.com/docker-library/docs/blob/master/README.md) before attempting a pull request.
|
|
|
+
|
|
|
+## Issues
|
|
|
+
|
|
|
+If you have any problems with or questions about this image, please contact us through a [GitHub issue](https://github.com/influxdata/telegraf-docker/issues). If the issue is related to a CVE, please check for [a `cve-tracker` issue on the `official-images` repository first](https://github.com/docker-library/official-images/issues?q=label%3Acve-tracker).
|
|
|
+
|
|
|
+You can also reach many of the official image maintainers via the `#docker-library` IRC channel on [Freenode](https://freenode.net).
|
|
|
+
|
|
|
+## Contributing
|
|
|
+
|
|
|
+You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
|
|
|
+
|
|
|
+Before you start to code, we recommend discussing your plans through a [GitHub issue](https://github.com/influxdata/telegraf-docker/issues), especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
|