Go to file
jaroug b2b361356e
Wildcard support for x509_cert files (#6952)
* Accept standard unix glob matching rules

* comply with indentation

* update readme

* move globing expand and url parsing into Init()

* chore: rebase branch on upstream master

* rename refreshFilePaths to expandFilePaths
* expandFilePaths handles '/path/to/*.pem' and 'files:///path/to/*.pem'
* update sample config

* fix: recompile files globing pattern at every gather tic

 * add var globFilePathsToUrls to stack files path
 * add var globpaths to stack compiled globpath
 * rework sourcesToURLs to compile files path and stack them
 * rename expandFilePaths to expandFilePathsToUrls
 * rework expandFilePathsToUrls to only match compiled globpath
 * rework the `Gather` ticker to match globpath at each call

* fix: comply with requested changes

 * add specifics regarding relative paths in sample config
 * add logger and use it in expandFilePathsToUrls()
 * precompile glob for `files://`, `/` and `://`

* fix: update README to match last changes

* fix: comply with last requested changes

 * rename expandFilePathsToUrls() to collectCertURLs()
 * collectCertURLs() now returns []*url.URL to avoid extra field
globFilePathsToUrls in structure
 * update the Gather() ticker accordingly

* fix(windows): do not try to compile glopath for windows path as it's not supposed to be supported by the OS

* fix(ci): apply go fmt

* fix(ci): empty-lines/import-shadowing

Co-authored-by: Anthony LE BERRE <aleberre@vente-privee.com>
2021-03-23 17:31:15 -04:00
.circleci Use endpoint to share artifacts (Tiger bot) (#9012) 2021-03-18 17:31:31 -04:00
.github Update PR template to encourage linking to issues (#9023) 2021-03-19 12:04:20 -06:00
agent Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
assets Mac Packaging / Notarization (#8878) 2021-03-05 10:14:01 -05:00
cmd/telegraf Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
config Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
docs New prometheus remote write parser (#8967) 2021-03-18 11:33:58 -04:00
etc Update changelog 2021-03-17 16:45:19 -04:00
filter Add test for include/exclude filter (#5193) 2018-12-26 13:15:13 -08:00
internal Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
logger Integration test audit (#8725) 2021-01-26 11:06:12 -07:00
metric Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
models Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
plugins Wildcard support for x509_cert files (#6952) 2021-03-23 17:31:15 -04:00
scripts Update to Go 1.16.2 (#8989) 2021-03-16 15:23:44 -04:00
selfstat Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
testutil Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
.gitattributes Fix tests for Windows - part 1 (#8414) 2020-11-23 10:40:32 -05:00
.gitignore Upgrade circle-ci config to v2.1 (#8621) 2021-01-06 16:23:29 -06:00
.golangci.yml Linter fixes - revive:unused-parameter, unparam, varcheck and unused (#8984) 2021-03-22 12:21:36 -05:00
.lgtm.yml Clearing LGTM alerts and warnings (#8923) 2021-03-03 14:56:31 -05:00
CHANGELOG.md update new plugins in changelog (#8991) 2021-03-19 13:56:39 -04:00
CONTRIBUTING.md Integration test audit (#8725) 2021-01-26 11:06:12 -07:00
EXTERNAL_PLUGINS.md feat: Adding Plex Webhooks external plugin (#8898) 2021-03-11 17:11:16 -05:00
LICENSE Build packages in makefile (#7759) 2020-06-30 00:15:28 -07:00
Makefile Update to Go 1.16.2 (#8989) 2021-03-16 15:23:44 -04:00
README.md Add input plugin for KNX home automation bus (#7048) 2021-03-18 08:39:44 -06:00
accumulator.go Fix aggregator window and shutdown of multiple aggregators (#5644) 2019-03-29 15:40:33 -07:00
aggregator.go add support for streaming processors (#7634) 2020-06-05 10:43:43 -04:00
build_version.txt Update build version to 1.19.0 2021-03-17 18:35:53 -04:00
docker-compose.yml Integration test audit (#8725) 2021-01-26 11:06:12 -07:00
go.mod Add support of the time module in Starlark Processor (#9004) 2021-03-23 13:45:29 -04:00
go.sum Add support of the time module in Starlark Processor (#9004) 2021-03-23 13:45:29 -04:00
info.plist Mac Packaging / Notarization (#8878) 2021-03-05 10:14:01 -05:00
input.go add plugin documentation 2020-10-14 12:27:16 -04:00
metric.go Fix spelling errors in comments and documentation (#7492) 2020-05-14 00:41:58 -07:00
output.go add plugin documentation 2020-10-14 12:27:16 -04:00
plugin.go exec plugins should not truncate messages in debug mode (#8333) 2021-03-18 17:21:30 -04:00
processor.go add plugin documentation 2020-10-14 12:27:16 -04:00

README.md

Telegraf Circle CI Docker pulls Total alerts

Slack Status

Telegraf is an agent for collecting, processing, aggregating, and writing metrics.

Design goals are to have a minimal memory footprint with a plugin system so that developers in the community can easily add support for collecting metrics.

Telegraf is plugin-driven and has the concept of 4 distinct plugin types:

  1. Input Plugins collect metrics from the system, services, or 3rd party APIs
  2. Processor Plugins transform, decorate, and/or filter metrics
  3. Aggregator Plugins create aggregate metrics (e.g. mean, min, max, quantiles, etc.)
  4. Output Plugins write metrics to various destinations

New plugins are designed to be easy to contribute, pull requests are welcomed and we work to incorporate as many pull requests as possible.

Try in Browser 🚀

You can try Telegraf right in your browser in the Telegraf playground.

Contributing

There are many ways to contribute:

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

Installation:

You can download the binaries directly from the downloads page or from the releases section.

Ansible Role:

Ansible role: https://github.com/rossmcdonald/telegraf

From Source:

Telegraf requires Go version 1.14 or newer, the Makefile requires GNU make.

  1. Install Go >=1.14 (1.15 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
    

Changelog

View the changelog for the latest updates and changes by version.

Nightly Builds

These builds are generated from the master branch:

How to use it:

See usage with:

telegraf --help

Generate a telegraf config file:

telegraf config > telegraf.conf

Generate config with only cpu input & influxdb output plugins defined:

telegraf --section-filter agent:inputs:outputs --input-filter cpu --output-filter influxdb config

Run a single telegraf collection, outputting metrics to stdout:

telegraf --config telegraf.conf --test

Run telegraf with all plugins defined in config file:

telegraf --config telegraf.conf

Run telegraf, enabling the cpu & memory input, and influxdb output plugins:

telegraf --config telegraf.conf --input-filter cpu:mem --output-filter influxdb

Documentation

Latest Release Documentation.

For documentation on the latest development code see the documentation index.

Input Plugins

Parsers

Serializers

Processor Plugins

Aggregator Plugins

Output Plugins