You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* telegraf: update logo and readme
Provide some additional details and give a general update to the README.
Removes a number of the examples as they are not helpful to the majority
of users.
Also update the influxdb logo.
* update couple sentences
* markdown lint fixes
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.
3
+
Telegraf is an open source agent for collecting, processing, aggregating, and writing metrics. Based on a plugin system to enable developers in the community to easily add support for additional metric collection. There are five distinct types of plugins:
4
+
5
+
- Input plugins collect metrics from the system, services, or 3rd party APIs
6
+
- Output plugins write metrics to various destinations
- Secret Store plugins are used to hide secrets from the configuration file
4
10
5
11
[Telegraf Official Docs](https://docs.influxdata.com/telegraf/latest/get_started/)
6
12
7
13
%%LOGO%%
8
14
9
-
## Using this image
15
+
#How to use this image
10
16
11
-
###Exposed Ports
17
+
## Exposed Ports
12
18
13
-
- 8125 StatsD
19
+
- 8125 UDP
14
20
- 8092 UDP
15
21
- 8094 TCP
16
22
17
-
### Using the default configuration
18
-
19
-
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.
20
-
21
-
Minimal example to start an InfluxDB container:
22
-
23
-
```console
24
-
$ docker run -d --name influxdb -p 8086:8086 influxdb
25
-
```
26
-
27
-
Starting Telegraf using the default config, which connects to InfluxDB at `http://localhost:8086/`:
23
+
## Configuration file
28
24
29
-
```console
30
-
$ docker run --net=container:influxdb %%IMAGE%%
31
-
```
25
+
The user is required to provide a valid configuration to use the image. A valid configuration has at least one input and one output plugin specified. The following will walk through the general steps to get going.
32
26
33
-
### Using a custom config file
27
+
### Basic Example
34
28
35
-
First, generate a sample configuration and save it as `telegraf.conf` on the host:
29
+
Configuration files are TOML-based files that declare which plugins to use. A very simple configuration file, `telegraf.conf`, that collects metrics from the system CPU and outputs the metrics to stdout looks like the following:
36
30
37
-
```console
38
-
$ docker run --rm %%IMAGE%% telegraf config > telegraf.conf
31
+
```toml
32
+
[[inputs.cpu]]
33
+
[[outputs.file]]
39
34
```
40
35
41
-
Once you've customized `telegraf.conf`, you can run the Telegraf container with it mounted in the expected location:
36
+
Once a user has a customized configuration file, they can launch a Telegraf container with it mounted in the expected location:
42
37
43
38
```console
44
39
$ docker run -v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro %%IMAGE%%
@@ -48,131 +43,26 @@ Modify `$PWD` to the directory where you want to store the configuration file.
48
43
49
44
Read more about the Telegraf configuration [here](https://docs.influxdata.com/telegraf/latest/administration/configuration/).
50
45
51
-
### Using the container with input plugins
52
-
53
-
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:
54
-
55
-
```console
56
-
$ docker network create influxdb
57
-
```
46
+
### Sample Configuration
58
47
59
-
Next, we'll start our InfluxDB container named `influxdb`:
48
+
Users can generate a sample configuration using the `config` subcommand. This will provide the user with a basic config that has a handful of input plugins enabled that collect data from the system. However, the user will still need to configure at least one output before the file is ready for use:
60
49
61
50
```console
62
-
$ docker run -d --name=influxdb \
63
-
--net=influxdb \
64
-
influxdb
65
-
```
66
-
67
-
The `telegraf.conf` configuration can now resolve the `influxdb` container by name:
68
-
69
-
```toml
70
-
[[outputs.influxdb]]
71
-
urls = ["http://influxdb:8086"]
72
-
```
73
-
74
-
Finally, we start our Telegraf container and verify functionality:
Verify the status page: [http://localhost:8090/nginx_status](http://localhost:8090/nginx_status).
133
-
134
-
Configure the nginx input plugin in your Telegraf configuration file:
135
-
136
-
```toml
137
-
[[inputs.nginx]]
138
-
urls = ["http://nginx:8090/nginx_status"]
139
-
```
140
-
141
-
Restart your `telegraf` container to pick up the changes:
142
-
143
-
```console
144
-
$ docker restart telegraf
145
-
```
146
-
147
-
#### StatsD
148
-
149
-
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.
One common use case for Telegraf is to monitor the Docker Engine Host from within a container. The recommended technique is to mount the host filesystems into the container and use environment variables to instruct Telegraf where to locate the filesystems.
178
68
@@ -191,7 +81,7 @@ $ docker run -d --name=telegraf \
191
81
%%IMAGE%%
192
82
```
193
83
194
-
###Monitoring docker containers
84
+
## Monitoring docker containers
195
85
196
86
To monitor other docker containers, you can use the docker plugin and mount the docker socket into the container. An example configuration is below:
197
87
@@ -212,7 +102,7 @@ $ docker run -d --name=telegraf \
212
102
213
103
Refer to the docker [plugin documentation](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/README.md) for more information.
214
104
215
-
###Install Additional Packages
105
+
## Install Additional Packages
216
106
217
107
Some plugins require additional packages to be installed. For example, the `ntpq` plugin requires `ntpq` command. It is recommended to create a custom derivative image to install any needed commands.
0 commit comments