aboutsummaryrefslogtreecommitdiff
path: root/src/garage
diff options
context:
space:
mode:
authormricher <maximilien.richer@gmail.com>2021-09-28 08:57:20 +0200
committerAlex Auvolat <alex@adnab.me>2022-03-14 10:51:12 +0100
commite349af13a7268d567c1bacc819af5b89c2d4231f (patch)
treeb50fc78efac150bbf3c005c33d39a874c5e37b41 /src/garage
parent9d44127245990cc55dbdff5a4bd0a1524348f110 (diff)
downloadgarage-e349af13a7268d567c1bacc819af5b89c2d4231f.tar.gz
garage-e349af13a7268d567c1bacc819af5b89c2d4231f.zip
Update dependencies and add admin module with metrics
- Global dependencies updated in Cargo.lock - New module created in src/admin to host: - the (future) admin REST API - the metric collection - add configuration block No metrics implemented yet
Diffstat (limited to 'src/garage')
-rw-r--r--src/garage/Cargo.toml1
-rw-r--r--src/garage/server.rs13
2 files changed, 13 insertions, 1 deletions
diff --git a/src/garage/Cargo.toml b/src/garage/Cargo.toml
index 463f83e7..22e0f0f0 100644
--- a/src/garage/Cargo.toml
+++ b/src/garage/Cargo.toml
@@ -27,6 +27,7 @@ garage_rpc = { version = "0.6.0", path = "../rpc" }
garage_table = { version = "0.6.0", path = "../table" }
garage_util = { version = "0.6.0", path = "../util" }
garage_web = { version = "0.6.0", path = "../web" }
+garage_admin = { version = "0.6.0", path = "../admin" }
bytes = "1.0"
git-version = "0.3.4"
diff --git a/src/garage/server.rs b/src/garage/server.rs
index f4d62e91..923df1cd 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -6,6 +6,7 @@ use garage_util::background::*;
use garage_util::config::*;
use garage_util::error::Error;
+use garage_admin::metrics::*;
use garage_api::run_api_server;
use garage_model::garage::Garage;
use garage_web::run_web_server;
@@ -34,6 +35,9 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
.open()
.expect("Unable to open sled DB");
+ info!("Configure and run admin web server...");
+ let admin_server_init = AdminServer::init();
+
info!("Initializing background runner...");
let watch_cancel = netapp::util::watch_ctrl_c();
let (background, await_background_done) = BackgroundRunner::new(16, watch_cancel.clone());
@@ -43,7 +47,7 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
let run_system = tokio::spawn(garage.system.clone().run(watch_cancel.clone()));
- info!("Crate admin RPC handler...");
+ info!("Create admin RPC handler...");
AdminRpcHandler::new(garage.clone());
info!("Initializing API server...");
@@ -58,6 +62,10 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
wait_from(watch_cancel.clone()),
));
+ info!("Configure and run admin web server...");
+ let admin_server =
+ tokio::spawn(admin_server_init.run(garage.clone(), wait_from(watch_cancel.clone())));
+
// Stuff runs
// When a cancel signal is sent, stuff stops
@@ -67,6 +75,9 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
if let Err(e) = web_server.await? {
warn!("Web server exited with error: {}", e);
}
+ if let Err(e) = admin_server.await? {
+ warn!("Admin web server exited with error: {}", e);
+ }
// Remove RPC handlers for system to break reference cycles
garage.system.netapp.drop_all_handlers();