-
Notifications
You must be signed in to change notification settings - Fork 5.6k
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
Add new command run
to replace --config
and --config-directory
#11740
Comments
If "run" is a subcommand, what does telegraf do when you call it without a subcommand? Running is the main purpose of the program so it feels natural to me to run without a subcommand. Removing or combining --config and --config-directory could be useful. |
I was thinking if you just run |
Action:
Option: Include directive in the config to point to other configs and directories instead of allowing to pass multiple. Goal: Choose an approach that reduce impact to the end user, but consistent with rest of commands. This might be too distributive and provide no benefit over |
Prometheus:
OpenTelemetry Collector: uses --config: https://opentelemetry.io/docs/collector/getting-started/#local |
At this point, given no 2.x, we are not going to revamp the CLI and instead maintain the current behavior. |
Backwards compatibility is required
Related: #11316
Deprecate the flags
--config, --config-directory
by addingDEPRECATED:
to theUsage
field for each. Then add a new commandrun
that will accept a configuration file or directory as a value and run Telegraf with the provided configurations. I assume it won't be a problem to have Telegraf check if the provided field is a file or a folder, opposed to needing separate flags for a file and directory. The flags--once, --quiet, --debug, --test, --test-wait
will also need to be moved to be flags under the commandrun
opposed to global as they are now. These global flags need to be marked as deprecated as well.Example of expected help output:
e.g.
telegraf run telegraf.conf
~ Run with a config named telegraf.conftelegraf run telegraf.conf,telegraf_dir
~ Run with a config named telegraf.conf and a directory called telegraf_dir containing configsThe text was updated successfully, but these errors were encountered: