Skip to content

fix(query): Some environment variable configurations do not work #18384

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

Merged
merged 3 commits into from
Jul 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 7 additions & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ serde_test = "1.0"
serde_urlencoded = "0.7.1"
serde_with = { version = "3.8.1" }
serde_yaml = { version = "0.9.34" }
serfig = "0.1.0"
serfig = { git = "https://github.com/datafuse-extras/serfig", rev = "610ac6d" }
sha1 = "0.10.5"
sha2 = "0.10.8"
simdutf8 = "0.1.4"
Expand Down
17 changes: 16 additions & 1 deletion src/query/config/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3529,7 +3529,7 @@ pub struct SpillConfig {
/// Allow space in bytes to spill to local disk.
pub spill_local_disk_max_bytes: u64,

// TODO: We need to fix StorageConfig so that it supports environment variables and command line injections.
// TODO: We need to fix StorageConfig so that it supports command line injections.
#[clap(skip)]
pub storage: Option<StorageConfig>,
}
Expand Down Expand Up @@ -3840,4 +3840,19 @@ mod test {
"default setting is different from default config, please check again"
)
}

#[test]
fn test_env() {
unsafe {
std::env::set_var("LOG_TRACING_OTLP_ENDPOINT", "http://127.0.2.1:1111");
std::env::set_var("LOG_TRACING_CAPTURE_LOG_LEVEL", "DebuG");
}

let cfg = Config::load_with_config_file("").unwrap();
assert_eq!(
cfg.log.tracing.tracing_otlp.endpoint,
"http://127.0.2.1:1111"
);
assert_eq!(cfg.log.tracing.tracing_capture_log_level, "DebuG");
}
}
Loading