aboutsummaryrefslogtreecommitdiff
path: root/src/garage/server.rs
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2022-02-17 23:28:23 +0100
committerAlex Auvolat <alex@adnab.me>2022-03-14 10:52:13 +0100
commit8c2fb0c066af7f68fdcfcdec96fa030af059bf63 (patch)
tree58a416058e31eda2cdb3a15c07e565a9ad674857 /src/garage/server.rs
parentb6561f6e1bcb6a8de13a186405a480e356df89d8 (diff)
downloadgarage-8c2fb0c066af7f68fdcfcdec96fa030af059bf63.tar.gz
garage-8c2fb0c066af7f68fdcfcdec96fa030af059bf63.zip
Add tracing integration with opentelemetry
Diffstat (limited to 'src/garage/server.rs')
-rw-r--r--src/garage/server.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/garage/server.rs b/src/garage/server.rs
index cd32d708..6ef36273 100644
--- a/src/garage/server.rs
+++ b/src/garage/server.rs
@@ -7,6 +7,7 @@ use garage_util::config::*;
use garage_util::error::Error;
use garage_admin::metrics::*;
+use garage_admin::tracing_setup::*;
use garage_api::run_api_server;
use garage_model::garage::Garage;
use garage_web::run_web_server;
@@ -45,6 +46,11 @@ pub async fn run_server(config_file: PathBuf) -> Result<(), Error> {
info!("Initializing Garage main data store...");
let garage = Garage::new(config.clone(), db, background);
+ info!("Initialize tracing...");
+ if let Some(export_to) = config.admin_api.otlp_export_traces_to {
+ init_tracing(&export_to, garage.system.id)?;
+ }
+
let run_system = tokio::spawn(garage.system.clone().run(watch_cancel.clone()));
info!("Create admin RPC handler...");