Integrate with external plugins
External plugins are external programs that are built outside
of Telegraf that can run through an execd
plugin. These external plugins allow for
more flexibility compared to internal Telegraf plugins. Benefits to using external plugins include:
- Access to libraries not written in Go
- Using licensed software (not available to open source community)
- Including large dependencies that would otherwise bloat Telegraf
- Using your external plugin immediately without waiting for the Telegraf team to publish
- Easily convert plugins between internal and external using the shim
Use the `execd` shim
The shim makes it easy to extract an internal input,
processor, or output plugin from the main Telegraf repo out to a stand-alone repo. This allows anyone to build and run it as a separate app using one of the
execd
plugins:
Extract a plugin using the shim wrapper
- Move the project to an external repo. We recommend preserving the path
structure: for example, if your plugin was located at
plugins/inputs/cpu
in the Telegraf repo, move it toplugins/inputs/cpu
in the new repo. - Copy main.go into your project under the
cmd
folder. This serves as the entry point to the plugin when run as a stand-alone program.The shim isn’t designed to run multiple plugins at the same time, so include only one plugin per repo.
Write an external plugin
Set up your plugin to use it with
execd
.For listed external plugins, the author of the external plugin is also responsible for the maintenance and feature development of external plugins.
- Write your Telegraf plugin. Follow InfluxData’s best practices:
- If your plugin is written in Go, follow the steps for the Execd Go Shim.
- Add usage and development instructions in the homepage of your repository for running your plugin with its respective
execd
plugin. Refer to openvpn and awsalarms for examples. Include the following steps:- How to download the release package for your platform or how to clone the binary for your external plugin
- Commands to build your binary
- Location to edit your
telegraf.conf
- Configuration to run your external plugin with inputs.execd, processors.execd or outputs.execd
- Submit your plugin by opening a PR to add your external plugin to the /EXTERNAL_PLUGINS.md list. Include the plugin name, a link to the plugin repository and a short description of the plugin.
Was this page helpful?
Thank you for your feedback!
Support and feedback
Thank you for being part of our community! We welcome and encourage your feedback and bug reports for Telegraf and this documentation. To find support, use the following resources:
Customers with an annual or support contract can contact InfluxData Support.