mirror of
https://github.com/openobserve/openobserve.git
synced 2026-11-05 16:10:43 +00:00
added instance id to config response (#459)
This commit is contained in:
@@ -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<HttpResponse, Error> {
|
||||
pub async fn zo_config() -> Result<HttpResponse, Error> {
|
||||
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,
|
||||
|
||||
@@ -627,7 +627,7 @@ fn handle_metrics_response(sources: Vec<json::Value>) -> Vec<json::Value> {
|
||||
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)
|
||||
|
||||
Reference in New Issue
Block a user