Move instrumentation to common crate

This commit is contained in:
Daniel Lundin 2024-12-16 18:46:14 +01:00
parent d8c8b7bb10
commit ffcea325f6
Signed by: dln
SSH key fingerprint: SHA256:dQy1Xj3UiqJYpKR5ggQ2bxgz4jCH8IF+k3AB8o0kmdI
10 changed files with 67 additions and 15 deletions

View file

@ -7,6 +7,7 @@ license = "MPL-2.0"
[dependencies]
anyhow.workspace = true
clap.workspace = true
patagia-common = { path = "../common" }
progenitor.workspace = true
reqwest.workspace = true
schemars.workspace = true

View file

@ -1,9 +1,9 @@
use anyhow::Result;
use clap::Parser;
use tokio::time::{sleep, Duration};
use tracing_subscriber::prelude::*;
mod patagia_api;
use patagia_common::instrumentation;
#[derive(Parser, Debug)]
#[command(version, about, long_about = None)]
@ -12,12 +12,7 @@ struct Cli {}
#[tokio::main]
async fn main() -> Result<()> {
let _args = Cli::parse();
let fmt_layer = tracing_subscriber::fmt::layer();
tracing_subscriber::registry()
.with(tracing_subscriber::EnvFilter::from_default_env())
.with(fmt_layer)
.init();
let _tracing = instrumentation::init_tracing_subscriber()?;
tracing::info!("Patagia Agent");