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

Update /about API #705

Merged
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
22 changes: 17 additions & 5 deletions server/src/handlers/http/about.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,12 @@ use actix_web::web::Json;
use human_size::SpecificSize;
use serde_json::json;

use crate::{about, option::CONFIG, storage::StorageMetadata, utils::update};
use crate::{
about,
option::{Mode, CONFIG},
storage::StorageMetadata,
utils::update,
};
use std::path::PathBuf;

pub async fn about() -> Json<serde_json::Value> {
Expand All @@ -40,11 +45,15 @@ pub async fn about() -> Json<serde_json::Value> {
let current_version = format!("v{}", current_release.released_version);
let commit = current_release.commit_hash;
let deployment_id = meta.deployment_id.to_string();
let mode = CONFIG.get_storage_mode_string();
let staging = CONFIG.staging_dir();
let mode = CONFIG.parseable.mode.to_str();
let staging = if CONFIG.parseable.mode == Mode::Query {
"".to_string()
} else {
CONFIG.staging_dir().display().to_string()
};
let grpc_port = CONFIG.parseable.grpc_port;

let store = CONFIG.storage().get_endpoint();
let store_endpoint = CONFIG.storage().get_endpoint();
let is_llm_active = &CONFIG.parseable.open_ai_key.is_some();
let llm_provider = is_llm_active.then_some("OpenAI");
let is_oidc_active = CONFIG.parseable.openid.is_some();
Expand Down Expand Up @@ -80,6 +89,9 @@ pub async fn about() -> Json<serde_json::Value> {
"staging": staging,
"cache": cache_details,
"grpcPort": grpc_port,
"store": store
"store": {
"type": CONFIG.get_storage_mode_string(),
"path": store_endpoint
}
}))
}
3 changes: 2 additions & 1 deletion server/src/handlers/http/modal/ingest_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ impl IngestServer {
web::scope(&base_path())
.service(Server::get_query_factory())
.service(Server::get_ingest_factory())
.service(Self::logstream_api()),
.service(Self::logstream_api())
.service(Server::get_about_factory()),
)
.service(Server::get_liveness_factory())
.service(Server::get_readiness_factory())
Expand Down
Loading