diff --git a/src/handler/http/request/status/mod.rs b/src/handler/http/request/status/mod.rs index 0a461e7b1f..d788e13624 100644 --- a/src/handler/http/request/status/mod.rs +++ b/src/handler/http/request/status/mod.rs @@ -19,7 +19,7 @@ use std::io::Error; use utoipa::ToSchema; use crate::common::json; -use crate::infra::config::{self, CONFIG}; +use crate::infra::config::{self, CONFIG, INSTANCE_ID}; use crate::infra::{cache, cluster}; use crate::meta::functions::ZoFunction; use crate::service::search::datafusion::DEFAULT_FUNCTIONS; @@ -32,6 +32,7 @@ pub struct HealthzResponse { #[derive(Serialize)] struct ConfigResponse<'a> { version: String, + instance: String, commit_hash: String, build_date: String, functions_enabled: bool, @@ -59,6 +60,7 @@ pub async fn healthz() -> Result { pub async fn zo_config() -> Result { Ok(HttpResponse::Ok().json(ConfigResponse { version: config::VERSION.to_string(), + instance: INSTANCE_ID.get("instance_id").unwrap().to_string(), commit_hash: config::COMMIT_HASH.to_string(), build_date: config::BUILD_DATE.to_string(), functions_enabled: config::HAS_FUNCTIONS, diff --git a/src/service/search.rs b/src/service/search.rs index b70ce5466c..67f2751b8b 100644 --- a/src/service/search.rs +++ b/src/service/search.rs @@ -627,7 +627,7 @@ fn handle_metrics_response(sources: Vec) -> Vec { fields.remove("value"); results_metrics.insert(key.clone(), json::Value::Object(fields)); } - let entry = results_values.entry(key).or_insert(Vec::new()); + let entry = results_values.entry(key).or_default(); let value = [ fields .get(&CONFIG.common.time_stamp_col)