Skip to content

Commit 7b128c7

Browse files
authored
telegraf: update logo and readme (#2328)
* 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
1 parent 3af7c3e commit 7b128c7

File tree

2 files changed

+32
-142
lines changed

2 files changed

+32
-142
lines changed

telegraf/content.md

Lines changed: 32 additions & 142 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,39 @@
1-
# Telegraf
1+
# What is telegraf?
22

3-
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
7+
- Processor plugins transform, decorate, and/or filter metrics
8+
- Aggregator plugins create aggregate metrics (e.g. mean, min, max, quantiles, etc.)
9+
- Secret Store plugins are used to hide secrets from the configuration file
410

511
[Telegraf Official Docs](https://docs.influxdata.com/telegraf/latest/get_started/)
612

713
%%LOGO%%
814

9-
## Using this image
15+
# How to use this image
1016

11-
### Exposed Ports
17+
## Exposed Ports
1218

13-
- 8125 StatsD
19+
- 8125 UDP
1420
- 8092 UDP
1521
- 8094 TCP
1622

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
2824

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.
3226

33-
### Using a custom config file
27+
### Basic Example
3428

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:
3630

37-
```console
38-
$ docker run --rm %%IMAGE%% telegraf config > telegraf.conf
31+
```toml
32+
[[inputs.cpu]]
33+
[[outputs.file]]
3934
```
4035

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:
4237

4338
```console
4439
$ 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.
4843

4944
Read more about the Telegraf configuration [here](https://docs.influxdata.com/telegraf/latest/administration/configuration/).
5045

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
5847

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:
6049

6150
```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:
75-
76-
```console
77-
$ docker run -d --name=telegraf \
78-
--net=influxdb \
79-
-v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
80-
%%IMAGE%%
81-
$ docker logs -f telegraf
82-
```
83-
84-
#### Aerospike
85-
86-
Start an instance of aerospike:
87-
88-
```console
89-
$ docker run -d --name aerospike \
90-
--net=influxdb \
91-
-p 3000-3003:3000-3003 \
92-
aerospike
93-
```
94-
95-
Edit your Telegraf config file and set the correct connection parameter for Aerospike:
96-
97-
```toml
98-
[[inputs.aerospike]]
99-
servers = ["aerospike:3000"]
100-
```
101-
102-
Restart your `telegraf` container to pick up the changes:
103-
104-
```console
105-
$ docker restart telegraf
106-
```
107-
108-
#### Nginx
109-
110-
Create an `nginx_status.conf` configuration file to expose metric data:
111-
112-
```nginx
113-
server {
114-
listen 8090;
115-
location /nginx_status {
116-
stub_status;
117-
access_log off;
118-
}
119-
}
120-
```
121-
122-
Start an Nginx container utilizing it:
123-
124-
```console
125-
$ docker run -d --name=nginx \
126-
--net=influxdb \
127-
-p 8090:8090 -p 8080:80 \
128-
-v $PWD/nginx_status.conf:/etc/nginx/conf.d/nginx_status.conf:ro \
129-
nginx
130-
```
131-
132-
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.
150-
151-
Run Telegraf with the UDP port 8125 exposed:
152-
153-
```console
154-
$ docker run -d --name=telegraf \
155-
--net=influxdb \
156-
-p 8125:8125/udp \
157-
-v $PWD/telegraf.conf:/etc/telegraf/telegraf.conf:ro \
158-
%%IMAGE%%
159-
```
160-
161-
Send Mock StatsD data:
162-
163-
```console
164-
$ for i in {1..50}; do echo $i;echo "foo:1|c" | nc -u -w0 127.0.0.1 8125; done
51+
$ docker run --rm %%IMAGE%% telegraf config > telegraf.conf
16552
```
16653

167-
Check that the measurement `foo` is added in the DB.
54+
## Supported Plugins Reference
16855

169-
### Supported Plugins Reference
56+
The following are links to the various plugins that are available in Telegraf:
17057

171-
- [Input Plugins](https://docs.influxdata.com/telegraf/latest/plugins/inputs/)
58+
- [Input Plugins](https://docs.influxdata.com/telegraf/latest/plugins/#input-plugins)
59+
- [Output Plugins](https://docs.influxdata.com/telegraf/latest/plugins/#output-plugins)
60+
- [Processor Plugins](https://docs.influxdata.com/telegraf/latest/plugins/#processor-plugins)
61+
- [Aggregator Plugins](https://docs.influxdata.com/telegraf/latest/plugins/#aggregator-plugins)
17262

173-
- [Output Plugins](https://docs.influxdata.com/telegraf/latest/plugins/outputs/)
63+
# Examples
17464

175-
### Monitoring the Docker Engine Host
65+
## Monitoring the Docker Engine Host
17666

17767
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.
17868

@@ -191,7 +81,7 @@ $ docker run -d --name=telegraf \
19181
%%IMAGE%%
19282
```
19383

194-
### Monitoring docker containers
84+
## Monitoring docker containers
19585

19686
To monitor other docker containers, you can use the docker plugin and mount the docker socket into the container. An example configuration is below:
19787

@@ -212,7 +102,7 @@ $ docker run -d --name=telegraf \
212102

213103
Refer to the docker [plugin documentation](https://github.com/influxdata/telegraf/blob/master/plugins/inputs/docker/README.md) for more information.
214104

215-
### Install Additional Packages
105+
## Install Additional Packages
216106

217107
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.
218108

telegraf/logo.png

3.02 KB
Loading

0 commit comments

Comments
 (0)