diff --git a/Cargo.lock b/Cargo.lock index 877d506c4..161966a3f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1807,15 +1807,6 @@ version = "2.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "12b6ee2129af8d4fb011108c73d99a1b83a85977f23b82460c0ae2e25bb4b57f" -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - [[package]] name = "itoa" version = "1.0.6" @@ -1903,20 +1894,9 @@ dependencies = [ "serde", "tokio", "tracing", - "tracing-loki", "tracing-subscriber", ] -[[package]] -name = "loki-api" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f56d36f573486ba7f462b62cbae597fef7d5d93665e7047956b457531b8a1ced" -dependencies = [ - "prost", - "prost-types", -] - [[package]] name = "lru-cache" version = "0.1.2" @@ -2526,38 +2506,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "prost" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b82eaa1d779e9a4bc1c3217db8ffbeabaae1dca241bf70183242128d48681cd" -dependencies = [ - "bytes", - "prost-derive", -] - -[[package]] -name = "prost-derive" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d2d8d10f3c6ded6da8b05b5fb3b8a5082514344d56c9f871412d29b4e075b4" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "prost-types" -version = "0.11.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213622a1460818959ac1181aaeb2dc9c7f63df720db7d788b3e24eacd1983e13" -dependencies = [ - "prost", -] - [[package]] name = "quick-error" version = "1.2.3" @@ -3596,17 +3544,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "tokio-stream" -version = "0.1.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" -dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-tungstenite" version = "0.21.0" @@ -3779,17 +3716,6 @@ dependencies = [ "valuable", ] -[[package]] -name = "tracing-log" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f751112709b4e791d8ce53e32c4ed2d353565a795ce84da2285393f41557bdf2" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - [[package]] name = "tracing-log" version = "0.2.0" @@ -3801,27 +3727,6 @@ dependencies = [ "tracing-core", ] -[[package]] -name = "tracing-loki" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49bbc87d08020d7c2a9f4bb0b7d10da5381d3867f8ae57fcc54621b34567e963" -dependencies = [ - "loki-api", - "reqwest 0.11.27", - "serde", - "serde_json", - "snap", - "tokio", - "tokio-stream", - "tracing", - "tracing-core", - "tracing-log 0.1.4", - "tracing-serde", - "tracing-subscriber", - "url", -] - [[package]] name = "tracing-serde" version = "0.1.3" @@ -3845,7 +3750,7 @@ dependencies = [ "smallvec", "thread_local", "tracing-core", - "tracing-log 0.2.0", + "tracing-log", "tracing-serde", ] diff --git a/Cargo.toml b/Cargo.toml index c37fc826b..ca3ea6c3a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -61,7 +61,6 @@ thiserror = "1.0.58" # LOGGING tracing-subscriber = { version = "0.3.18", features = ["json"] } tracing = "0.1.40" -tracing-loki = "0.2.4" # CONFIG clap = { version = "4.5.3", features = ["derive"] } diff --git a/bin/core/src/api/auth.rs b/bin/core/src/api/auth.rs index 19db1bb0d..197c3cc25 100644 --- a/bin/core/src/api/auth.rs +++ b/bin/core/src/api/auth.rs @@ -50,7 +50,7 @@ pub fn router() -> Router { router } -#[instrument(name = "AuthHandler")] +#[instrument(name = "AuthHandler", level = "debug", skip(headers))] async fn handler( headers: HeaderMap, Json(request): Json, @@ -60,10 +60,10 @@ async fn handler( debug!("/auth request {req_id} | METHOD: {}", request.req_type()); let res = State.resolve_request(request, headers).await; if let Err(resolver_api::Error::Serialization(e)) = &res { - warn!("/auth request {req_id} | serialization error: {e:?}"); + debug!("/auth request {req_id} | serialization error: {e:?}"); } if let Err(resolver_api::Error::Inner(e)) = &res { - warn!("/auth request {req_id} | error: {e:#}"); + debug!("/auth request {req_id} | error: {e:#}"); } let elapsed = timer.elapsed(); debug!("/auth request {req_id} | resolve time: {elapsed:?}"); diff --git a/bin/core/src/config.rs b/bin/core/src/config.rs index b428480f0..4f3d91c02 100644 --- a/bin/core/src/config.rs +++ b/bin/core/src/config.rs @@ -49,7 +49,6 @@ pub fn core_config() -> &'static CoreConfig { // logging monitor_logging_level: Option, monitor_logging_stdio: Option, - monitor_logging_loki_url: Option, monitor_local_auth: Option, @@ -122,8 +121,6 @@ pub fn core_config() -> &'static CoreConfig { env.monitor_logging_level.unwrap_or(config.logging.level); config.logging.stdio = env.monitor_logging_stdio.unwrap_or(config.logging.stdio); - config.logging.loki_url = - env.monitor_logging_loki_url.or(config.logging.loki_url); config.local_auth = env.monitor_local_auth.unwrap_or(config.local_auth); diff --git a/bin/periphery/src/config.rs b/bin/periphery/src/config.rs index 440836096..e0fff79d1 100644 --- a/bin/periphery/src/config.rs +++ b/bin/periphery/src/config.rs @@ -20,7 +20,6 @@ struct Env { port: Option, log_level: Option, stdio_log_mode: Option, - loki_url: Option, } fn default_config_paths() -> Vec { @@ -76,8 +75,6 @@ pub fn periphery_config() -> &'static PeripheryConfig { env.log_level.unwrap_or(config.logging.level); config.logging.stdio = env.stdio_log_mode.unwrap_or(config.logging.stdio); - config.logging.loki_url = - env.loki_url.clone().or(config.logging.loki_url); config }) diff --git a/lib/logger/Cargo.toml b/lib/logger/Cargo.toml index a0425ef85..33e312d53 100644 --- a/lib/logger/Cargo.toml +++ b/lib/logger/Cargo.toml @@ -12,5 +12,4 @@ tokio.workspace = true serde.workspace = true anyhow.workspace = true tracing.workspace = true -tracing-loki.workspace = true tracing-subscriber.workspace = true diff --git a/lib/logger/src/lib.rs b/lib/logger/src/lib.rs index 244c53fa6..6433da8ce 100644 --- a/lib/logger/src/lib.rs +++ b/lib/logger/src/lib.rs @@ -1,7 +1,6 @@ use anyhow::Context; use serde::{Deserialize, Serialize}; use tracing::level_filters::LevelFilter; -use tracing_loki::url::Url; use tracing_subscriber::{ layer::SubscriberExt, util::SubscriberInitExt, }; @@ -15,9 +14,6 @@ pub struct LogConfig { /// Controls logging to stdout / stderr #[serde(default)] pub stdio: StdioLogMode, - - /// Send tracing logs to loki - pub loki_url: Option, } pub fn init(config: &LogConfig) -> anyhow::Result<()> { @@ -26,41 +22,19 @@ pub fn init(config: &LogConfig) -> anyhow::Result<()> { let registry = tracing_subscriber::registry().with(LevelFilter::from(log_level)); - match (config.stdio, &config.loki_url) { - (StdioLogMode::Standard, Some(loki_url)) => registry - .with(loki_layer(loki_url)?) + match config.stdio { + StdioLogMode::Standard => registry .with(tracing_subscriber::fmt::layer()) .try_init() .context("failed to init logger"), - (StdioLogMode::Json, Some(loki_url)) => registry - .with(loki_layer(loki_url)?) + StdioLogMode::Json => registry .with(tracing_subscriber::fmt::layer().json()) .try_init() .context("failed to init logger"), - (StdioLogMode::None, Some(loki_url)) => registry - .with(loki_layer(loki_url)?) - .try_init() - .context("failed to init logger"), - (StdioLogMode::Standard, None) => registry - .with(tracing_subscriber::fmt::layer()) - .try_init() - .context("failed to init logger"), - (StdioLogMode::Json, None) => registry - .with(tracing_subscriber::fmt::layer().json()) - .try_init() - .context("failed to init logger"), - (StdioLogMode::None, None) => Ok(()), + StdioLogMode::None => Ok(()), } } -fn loki_layer(loki_url: &str) -> anyhow::Result { - let (layer, task) = tracing_loki::builder() - .label("host", "mine")? - .build_url(Url::parse(loki_url)?)?; - tokio::spawn(task); - Ok(layer) -} - #[derive( Debug, Clone,