Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

REST api support to manage telegraf configuration #7519

Closed
pravindamodaran opened this issue May 15, 2020 · 3 comments
Closed

REST api support to manage telegraf configuration #7519

pravindamodaran opened this issue May 15, 2020 · 3 comments

Comments

@pravindamodaran
Copy link

pravindamodaran commented May 15, 2020

Feature Request

Proposal:

Expose api's using REST/RESTCONF/any other protocols to manage telegraf plugin configuration on the fly.

Current behavior:

Configuration can be reloaded by sending SIGHUP signal to telegraf process through CLI. This refreshes the whole configuration and restarts plugins, so there is chance of losing data within this period. Also, the telegraf docker images do not contain the linux library to use systemctl command, hence restricts refreshing config in docker-compose and k8s deployment. So this does not look like the way to update config in production.

Desired behavior:

Expose GET/PUT/POST/DELETE (or) any other methods to manage plugin configuration, without needing to refresh the whole config/restarting the plugins.

Use case:

External systems like NMS/SDN controller/other telemetry management services need to communicate with telegraf to automate start/stop of telemetry data collection from devices based on changes in network topology. Currently without any api exposed, it is not possible for external systems to achieve this. Would be nice to have this feature.

@pravindamodaran
Copy link
Author

Looks like influxdb-client has API's for telegraf configuration management. Still, telegraf needs to pull the config from influxdb and use them for reload using SIGHUP.

@ssoroka ssoroka added this to the Planned milestone Sep 30, 2020
@sjwang90 sjwang90 removed this from the Planned milestone Jan 29, 2021
@sjwang90 sjwang90 added this to the 2.0.0 milestone Aug 9, 2021
@isodude
Copy link
Contributor

isodude commented Jan 13, 2022

Can we have a sysctl version of telegraf that uses the API? maybe inside telegraf config

Proposal:

Add params to view parsed config
Add params to change config and write to disk
Add params to verify config

Current behavior:

Telegraf can only generate example config

Desired behavior:

Telegraf can fully manage config
Use case:

Ease of use during

troubleshooting
deployment

Instead of creating files, I can generate and validate my input and thus always having correct config.
I could verify the config to make sure that everything checks out. This could be a ExecPreStart much like nginx.

Instead of poking through files I can print telegraf config and view what is set.

Adding or changing config for a plugin is simpler on a broad scale by just running one command to change a specific setting for a plugin.

Examples:

telegraf config set --drop-dir /etc/telegraf/conf.d outputs.influxdb.cert_key "/path/to/cert"

telegraf config get --drop-dir /etc/telegraf/conf.d outputs.influxdb.cert_key

telegraf config validate --drop-dir /etc/telegraf/conf.d

@powersj
Copy link
Contributor

powersj commented Jan 23, 2023

A REST API for telegraf is something that has come up from time to time. Telegraf is a config driven agent. We are very happy to see improvements to how those configs are managed, whether it is local or remote configs, and land those types of changes.

The requested API is not something that is in plan and as such I am going to close this issue. We strive to get our list of issues and feature requests to things that we reasonably will do and not keep things open that in reality won't happen.

Thanks

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Jan 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants