Skip to content

Commit a12c252

Browse files
authored
feat: add more log or core (openobserve#481)
1 parent 39b11a9 commit a12c252

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

src/handler/http/router/openapi.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ use crate::meta;
110110
meta::organization::OrgUser,
111111
meta::organization::IngestionPasscode,
112112
meta::organization::PasscodeResponse,
113-
request::status::HealthzResponse,
113+
request::status::HealthzResponse,
114114
),
115115
),
116116
modifiers(&SecurityAddon),

src/infra/config.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,8 @@ pub struct Common {
173173
pub telemetry_url: String,
174174
#[env_config(name = "ZO_PROMETHEUS_ENABLED", default = false)]
175175
pub prometheus_enabled: bool,
176+
#[env_config(name = "ZO_PRINT_KEY_CONFIG", default = false)]
177+
pub print_key_config: bool,
176178
}
177179

178180
#[derive(EnvConfig)]
@@ -237,7 +239,7 @@ pub struct Log {
237239
pub level: String,
238240
}
239241

240-
#[derive(EnvConfig)]
242+
#[derive(Debug, EnvConfig)]
241243
pub struct Etcd {
242244
#[env_config(name = "ZO_ETCD_ADDR", default = "localhost:2379")]
243245
pub addr: String,
@@ -275,7 +277,7 @@ pub struct Sled {
275277
pub prefix: String,
276278
}
277279

278-
#[derive(EnvConfig)]
280+
#[derive(Debug, EnvConfig)]
279281
pub struct S3 {
280282
#[env_config(name = "ZO_S3_PROVIDER", default = "")]
281283
pub provider: String,

src/infra/db/etcd.rs

+3
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,9 @@ pub async fn connect_etcd() -> Option<etcd_client::Client> {
417417
if CONFIG.common.local_mode {
418418
return None;
419419
}
420+
if CONFIG.common.print_key_config {
421+
log::info!("etcd init config: {:?}", CONFIG.etcd);
422+
}
420423

421424
let mut opts = etcd_client::ConnectOptions::new()
422425
.with_timeout(core::time::Duration::from_secs(CONFIG.etcd.command_timeout))

src/infra/storage/s3.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,6 @@ impl S3 {
205205

206206
async fn init_s3_config() -> Option<Config> {
207207
let mut s3config = aws_sdk_s3::config::Builder::new();
208-
209208
if !CONFIG.s3.server_url.is_empty() {
210209
s3config = s3config.endpoint_url(&CONFIG.s3.server_url);
211210
if CONFIG.s3.provider.eq("minio") {
@@ -244,6 +243,9 @@ async fn init_s3_client() -> Option<Client> {
244243
if is_local_disk_storage() {
245244
return None;
246245
}
246+
if CONFIG.common.print_key_config {
247+
log::info!("s3 init config: {:?}", CONFIG.s3);
248+
}
247249

248250
let client = if CONFIG.s3.provider.eq("aws") {
249251
let s3config = aws_config::from_env()

0 commit comments

Comments
 (0)