telegraf/README.md

139 lines
4.8 KiB
Markdown
Raw Normal View History

2021-08-04 05:03:33 +08:00
# Telegraf
![tiger](TelegrafTiger.png "tiger")
[![Circle CI](https://circleci.com/gh/influxdata/telegraf.svg?style=svg)](https://circleci.com/gh/influxdata/telegraf) [![Docker pulls](https://img.shields.io/docker/pulls/library/telegraf.svg)](https://hub.docker.com/_/telegraf/) [![Total alerts](https://img.shields.io/lgtm/alerts/g/influxdata/telegraf.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/influxdata/telegraf/alerts/)
[![Slack Status](https://img.shields.io/badge/slack-join_chat-white.svg?logo=slack&style=social)](https://www.influxdata.com/slack)
2015-05-20 13:26:13 +08:00
2018-09-18 02:45:08 +08:00
Telegraf is an agent for collecting, processing, aggregating, and writing metrics.
2015-06-20 00:34:27 +08:00
2021-09-21 19:02:13 +08:00
Design goal:
- Have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics.
2015-06-20 00:34:27 +08:00
2018-09-18 02:45:08 +08:00
Telegraf is plugin-driven and has the concept of 4 distinct plugin types:
1. [Input Plugins](/docs/INPUTS.md) collect metrics from the system, services, or 3rd party APIs
2. [Processor Plugins](/docs/PROCESSORS.md) transform, decorate, and/or filter metrics
3. [Aggregator Plugins](/docs/AGGREGATORS.md) create aggregate metrics (e.g. mean, min, max, quantiles, etc.)
4. [Output Plugins](/docs/OUTPUTS.md) write metrics to various destinations
2021-09-21 19:02:13 +08:00
New plugins are designed to be easy to contribute, pull requests are welcomed and we work to incorporate as many pull requests as possible. If none of the internal plugins fit your needs, you could have a look at the
2021-07-07 05:20:53 +08:00
[list of external plugins](EXTERNAL_PLUGINS.md).
## Minimum Requirements
Telegraf shares the same [minimum requirements][] as Go:
- Linux kernel version 2.6.23 or later
- Windows 7 or later
- FreeBSD 11.2 or later
- MacOS 10.11 El Capitan or later
[minimum requirements]: https://github.com/golang/go/wiki/MinimumRequirements#minimum-requirements
## Installation:
2015-05-20 13:26:13 +08:00
2017-07-19 04:51:44 +08:00
You can download the binaries directly from the [downloads](https://www.influxdata.com/downloads) page
or from the [releases](https://github.com/influxdata/telegraf/releases) section.
2016-03-17 23:53:55 +08:00
2016-01-31 02:53:17 +08:00
### Ansible Role:
Ansible role: https://github.com/rossmcdonald/telegraf
### From Source:
Telegraf requires Go version 1.17 or newer, the Makefile requires GNU make.
2017-07-22 02:15:00 +08:00
1. [Install Go](https://golang.org/doc/install) >=1.17 (1.17.2 recommended)
2. Clone the Telegraf repository:
```
cd ~/src
git clone https://github.com/influxdata/telegraf.git
```
3. Run `make` from the source directory
```
cd ~/src/telegraf
make
```
2018-11-06 05:52:14 +08:00
### Changelog
View the [changelog](/CHANGELOG.md) for the latest updates and changes by
version.
2017-08-24 06:42:25 +08:00
### Nightly Builds
2021-09-17 01:22:24 +08:00
[Nightly](/docs/NIGHTLIES.md) builds are available, generated from the master branch.
### 3rd Party Builds
Builds for other platforms or package formats are provided by members of the Telegraf community. These packages are not built, tested or supported by the Telegraf project or InfluxData, we make no guarantees that they will work. Please get in touch with the package author if you need support.
* Windows
* [Chocolatey](https://chocolatey.org/packages/telegraf) by [ripclawffb](https://chocolatey.org/profiles/ripclawffb)
* [Scoop](https://github.com/ScoopInstaller/Main/blob/master/bucket/telegraf.json)
* Linux
* [Snap](https://snapcraft.io/telegraf) by Laurent Sesquès (sajoupa)
2016-01-31 02:53:17 +08:00
## How to use it:
2015-06-20 09:53:35 +08:00
See usage with:
2016-01-08 06:21:10 +08:00
```
2018-09-18 02:45:08 +08:00
telegraf --help
```
2016-01-08 06:21:10 +08:00
#### Generate a telegraf config file:
2016-01-08 06:21:10 +08:00
```
2018-09-18 02:45:08 +08:00
telegraf config > telegraf.conf
```
2016-01-08 06:21:10 +08:00
2017-08-04 02:54:05 +08:00
#### Generate config with only cpu input & influxdb output plugins defined:
```
telegraf --section-filter agent:inputs:outputs --input-filter cpu --output-filter influxdb config
```
2016-01-08 06:21:10 +08:00
#### Run a single telegraf collection, outputting metrics to stdout:
2016-01-08 06:21:10 +08:00
```
2018-09-18 02:45:08 +08:00
telegraf --config telegraf.conf --test
```
2016-01-08 06:21:10 +08:00
2017-08-04 02:54:05 +08:00
#### Run telegraf with all plugins defined in config file:
2016-01-08 06:21:10 +08:00
```
2018-09-18 02:45:08 +08:00
telegraf --config telegraf.conf
```
2016-01-08 06:21:10 +08:00
2017-08-04 02:54:05 +08:00
#### Run telegraf, enabling the cpu & memory input, and influxdb output plugins:
2016-01-08 06:21:10 +08:00
```
2018-09-18 02:45:08 +08:00
telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb
```
2018-09-18 02:45:08 +08:00
## Documentation
[Latest Release Documentation][release docs].
2015-05-20 13:26:13 +08:00
For documentation on the latest development code see the [documentation index](/docs).
2018-09-18 02:45:08 +08:00
[release docs]: https://docs.influxdata.com/telegraf
2021-09-21 19:02:13 +08:00
[developer docs]: docs
- [Input Plugins](/docs/INPUTS.md)
- [Output Plugins](/docs/OUTPUTS.md)
- [Processor Plugins](/docs/PROCESSORS.md)
- [Aggregator Plugins](/docs/AGGREGATORS.md)
2021-09-21 19:02:13 +08:00
## Contributing
There are many ways to contribute:
- Fix and [report bugs](https://github.com/influxdata/telegraf/issues/new)
- [Improve documentation](https://github.com/influxdata/telegraf/issues?q=is%3Aopen+label%3Adocumentation)
- [Review code and feature proposals](https://github.com/influxdata/telegraf/pulls)
- Answer questions and discuss here on github and on the [Community Site](https://community.influxdata.com/)
- [Contribute plugins](CONTRIBUTING.md)
- [Contribute external plugins](docs/EXTERNAL_PLUGINS.md)