From 97b6fc7db731e1e1244006aacbcd8581d5b9e3a3 Mon Sep 17 00:00:00 2001 From: Ahmed Farghal Date: Tue, 17 Dec 2024 18:01:35 +0000 Subject: [PATCH] Compile-time feature no-trace-logging to filter trace logging At the moment, this is an opt-in feature (build with `-F no-trace-logging` to enable). We might decide to filter trace logging from our docker builds after experimenting with this. --- benchmarks/Cargo.toml | 1 + cli/Cargo.toml | 1 + crates/core/src/metadata_store.rs | 3 +-- server/Cargo.toml | 1 + tools/restatectl/Cargo.toml | 1 + 5 files changed, 5 insertions(+), 2 deletions(-) diff --git a/benchmarks/Cargo.toml b/benchmarks/Cargo.toml index 6c17a869e4..aadadd524b 100644 --- a/benchmarks/Cargo.toml +++ b/benchmarks/Cargo.toml @@ -10,6 +10,7 @@ publish = false [features] default = [] frame-pointer = ["pprof/frame-pointer"] +no-trace-logging = ["tracing/max_level_debug", "tracing/release_max_level_debug"] [dependencies] restate-core = { workspace = true } diff --git a/cli/Cargo.toml b/cli/Cargo.toml index e408f04d3c..9bb4b56504 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -13,6 +13,7 @@ build = "build.rs" [features] default = ["cloud"] cloud = [] +no-trace-logging = ["tracing/max_level_debug", "tracing/release_max_level_debug"] [dependencies] restate-admin-rest-model = { workspace = true } diff --git a/crates/core/src/metadata_store.rs b/crates/core/src/metadata_store.rs index 017611c773..3542226f5f 100644 --- a/crates/core/src/metadata_store.rs +++ b/crates/core/src/metadata_store.rs @@ -23,8 +23,7 @@ use restate_types::{flexbuffers_storage_encode_decode, Version, Versioned}; use std::future::Future; use std::sync::Arc; use std::time::{Duration, Instant}; -use tracing::log::trace; -use tracing::{debug, info}; +use tracing::{debug, info, trace}; #[derive(Debug, thiserror::Error)] pub enum ReadError { diff --git a/server/Cargo.toml b/server/Cargo.toml index 683b858007..fb5e3cb0e5 100644 --- a/server/Cargo.toml +++ b/server/Cargo.toml @@ -29,6 +29,7 @@ options_schema = [ memory-loglet = ["restate-node/memory-loglet", "restate-admin/memory-loglet"] replicated-loglet = ["restate-node/replicated-loglet", "restate-admin/replicated-loglet"] crate_per_service = ["restate-tracing-instrumentation/service_per_crate"] +no-trace-logging = ["tracing/max_level_debug", "tracing/release_max_level_debug"] [dependencies] restate-admin = { workspace = true } diff --git a/tools/restatectl/Cargo.toml b/tools/restatectl/Cargo.toml index 6befdf09a1..baa6f11f36 100644 --- a/tools/restatectl/Cargo.toml +++ b/tools/restatectl/Cargo.toml @@ -13,6 +13,7 @@ replicated-loglet = [ "restate-bifrost/replicated-loglet", ] memory-loglet = ["restate-types/memory-loglet", "restate-bifrost/memory-loglet", "restate-admin/memory-loglet"] +no-trace-logging = ["tracing/max_level_debug", "tracing/release_max_level_debug"] [dependencies] restate-admin = { workspace = true, features = ["clients"] }