Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Add a gRPC based plugin system #3813
Add a plugin system, similar to #1717 but using gRPC.
Plugins must be compiled into Telegraf directly. The only option for external code is the
Be able to create plugins that can be compiled and maintained separately from Telegraf, and have improved performance with support for event driven
Some plugins cannot be submitted to, is not general purpose enough for, or for other reasons cannot be included in the main Telegraf build. Allowing the plugin to be compiled separately and loaded at runtime into any supporting Telegraf version will reduce the overhead of maintaining these plugins.
referenced this issue
Feb 20, 2018
2 questions to start off with, more to follow depending on the answers:
We would probably move some of the plugins into an optional package, perhaps on Debian we would have multiple packages: telegraf.deb and telegraf-extras.deb.
I think that only the gRPC server needs to run a HTTP/2 server while the client just makes HTTP/2 calls. Due to the size overhead, we probably will want to allow including multiple plugins to be in each gRPC process.
I would sure like it if Telegraf launched the plugins and managed their lifecycles itself.
We could also investigate basing it on https://github.com/hashicorp/go-plugin
Do you mean that telegraf isn't going to do the scheduled polling of each plugin? It'll be up to the plugin to push its metrics on the configured interval?
there is a standard API call for healthcheck https://github.com/grpc/grpc/blob/master/doc/health-checking.md
I don't see why the plugin couldn't handle the interval itself. However, one goal we should have is to keep grpc plugin writing as simple as possible. The more we logic we push off to the client the more complicated it will be, and while we could provide a helper library, this somewhat reduces the ease of writing in unsupported languages. It does seems pretty likely we would need a helper library anyway, so maybe its not a big concern.