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

Modify the logic that converts the parsing environment to flags. #2037

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

quzard
Copy link
Collaborator

@quzard quzard commented Jan 14, 2025

  1. ilogtail时代gflag不进行变化例如logtail_profile_aliuid,ilogtail_discard_interval
  2. LoongCollector时代gflag均不佳前缀例如loongcollector_conf_dir改为conf_dir
  3. 不保留gflag同名小写字母环境变量自动转flag的行为,只把留下重要的gflag本名变成7中的额外转换规则例如check_point_filename在文档中暴露,需要添加为额外转换规则,dirfile_stat_sleep从未暴露过,不再支持小写env。
  4. 保留原有特殊env转flag的行为。例如ALIYUN_LOGTAIL_WORKING_HOSTNAME,继续保留。
  5. go插件的env继续保留,若与C++原来就有同名env则必须配套增加LOONG_XXX的名字以统一兼容。Go系统参数不需要增加LOONG开头的名字,如GOGC、GOMEMLIMIT。
  6. 自动为gflag生成LOONG_upper(flag_name)环境变量转flag的行为
  7. 允许额外增加转换规则,包含3中的额外转换规则和4中比本地配置优先级更高的特殊env(这里逻辑保持不变即可)

@quzard quzard changed the title modi modify ParseEnvToFlags Jan 14, 2025
@quzard quzard changed the title modify ParseEnvToFlags Modify the logic that converts the parsing environment to flags. Jan 14, 2025
core/app_config/AppConfig.cpp Outdated Show resolved Hide resolved
core/app_config/AppConfig.cpp Outdated Show resolved Hide resolved
core/prometheus/PrometheusInputRunner.cpp Outdated Show resolved Hide resolved
PROCESSDIRFLAG(loongcollector_run_dir);
PROCESSDIRFLAG(loongcollector_third_party_dir);
PROCESSDIRFLAG(conf_dir);
if (STRING_FLAG(log_dir).empty()) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

合理性待讨论

plugin_main/plugin_export.go Show resolved Hide resolved
pkg/flags/flags.go Outdated Show resolved Hide resolved
pkg/flags/flags.go Show resolved Hide resolved
pkg/flags/flags.go Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants