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

Add new command run to replace --config and --config-directory #11740

Closed
sspaink opened this issue Aug 29, 2022 · 5 comments
Closed

Add new command run to replace --config and --config-directory #11740

sspaink opened this issue Aug 29, 2022 · 5 comments
Labels
feature request Requests for new plugin and for new features to existing plugins size/l 1 week or more effort

Comments

@sspaink
Copy link
Contributor

sspaink commented Aug 29, 2022

Backwards compatibility is required

Related: #11316

Deprecate the flags --config, --config-directory by adding DEPRECATED: to the Usage field for each. Then add a new command run 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 command run opposed to global as they are now. These global flags need to be marked as deprecated as well.

Example of expected help output:

NAME:
   Telegraf run value - Run telegraf with a provided config

USAGE:
   Telegraf run value (accepts multiple inputs)

e.g.

telegraf run telegraf.conf ~ Run with a config named telegraf.conf

telegraf run telegraf.conf,telegraf_dir ~ Run with a config named telegraf.conf and a directory called telegraf_dir containing configs

@sspaink sspaink added feature request Requests for new plugin and for new features to existing plugins size/m 2-4 day effort size/l 1 week or more effort and removed size/m 2-4 day effort labels Aug 29, 2022
@reimda
Copy link
Contributor

reimda commented Sep 6, 2022

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.

@sspaink
Copy link
Contributor Author

sspaink commented Sep 6, 2022

I was thinking if you just run telegraf then it will print the help information, similar to what git does when you just run git. It is a good point that running Telegraf with a config is its main purpose, but the benefit I like of adding the run command is it cleans up the help information organizing all the flags that are relevant to running Telegraf into one section.

@sspaink
Copy link
Contributor Author

sspaink commented Sep 7, 2022

Action:

  • Research other daemons are doing, should it display help when just running telegraf?
  • Check with other teams.

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 --config and --config-directory.

@sjwang90
Copy link
Contributor

sjwang90 commented Sep 29, 2022

Prometheus: ./prometheus --config.file=prometheus.yml
DataDog: <AGENT_BIN_PATH> <SUB_COMMAND> <OPTIONS>

  • it appears you can't change the file location of the datadog agent config. have to use the the default file or directory locations)

OpenTelemetry Collector: uses --config: https://opentelemetry.io/docs/collector/getting-started/#local
fluentd: also uses --config https://docs.fluentd.org/deployment/command-line-option#fluentd

@powersj
Copy link
Contributor

powersj commented Nov 7, 2023

At this point, given no 2.x, we are not going to revamp the CLI and instead maintain the current behavior.

@powersj powersj closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Requests for new plugin and for new features to existing plugins size/l 1 week or more effort
Projects
None yet
Development

No branches or pull requests

4 participants