diff --git a/bin/fxt/src/auth/interceptor.rs b/bin/fxt/src/auth/interceptor.rs index 85d988971..7310300f7 100644 --- a/bin/fxt/src/auth/interceptor.rs +++ b/bin/fxt/src/auth/interceptor.rs @@ -35,7 +35,7 @@ impl Interceptor for AuthInterceptor { // Parse as metadata value let token_value = bearer_token.parse::>().map_err(|e| { - tracing::error!("Failed to parse JWT as metadata value: {}", e); + tracing::error!("JWT metadata value parse rejected: {}", e); Status::internal("Invalid token format") })?; diff --git a/bin/fxt/src/auth/jwt_generator.rs b/bin/fxt/src/auth/jwt_generator.rs index 65ea1e8a6..2a6660084 100644 --- a/bin/fxt/src/auth/jwt_generator.rs +++ b/bin/fxt/src/auth/jwt_generator.rs @@ -56,7 +56,7 @@ impl Default for JwtConfig { .and_then(|c| c.jwt_secret) }) .unwrap_or_else(|| { - tracing::warn!("JWT_SECRET not set and no jwt_secret in config.toml - using development fallback"); + tracing::debug!("JWT_SECRET not set and no jwt_secret in config.toml - using development fallback"); "test-secret-must-be-at-least-64-characters-long-for-security-validation-ok-1234567890".to_owned() }); Self { diff --git a/bin/fxt/src/auth/login.rs b/bin/fxt/src/auth/login.rs index 5a8c9bea1..670e4f694 100644 --- a/bin/fxt/src/auth/login.rs +++ b/bin/fxt/src/auth/login.rs @@ -111,7 +111,7 @@ impl LoginClient { // TODO: Call API login endpoint via gRPC // For now, simulate a successful login response if Self::is_api_available() { - tracing::warn!( + tracing::debug!( "API configured but gRPC client not yet implemented -- using simulation" ); } @@ -201,7 +201,7 @@ impl LoginClient { // TODO: Call API MFA endpoint via gRPC if Self::is_api_available() { - tracing::warn!( + tracing::debug!( "API configured but gRPC client not yet implemented -- using simulation" ); } @@ -242,7 +242,7 @@ impl LoginClient { // TODO: Call API refresh endpoint via gRPC if Self::is_api_available() { - tracing::warn!( + tracing::debug!( "API configured but gRPC client not yet implemented -- using simulation" ); } @@ -286,8 +286,8 @@ impl LoginClient { Ok(true) }, Err(e) => { - tracing::warn!( - "Silent login failed: {} - will require interactive login", + tracing::debug!( + "Silent login could not refresh token: {} - will require interactive login", e ); Ok(false) diff --git a/bin/fxt/src/tui/data_fetcher.rs b/bin/fxt/src/tui/data_fetcher.rs index 5d4e20d5b..bf9223ab6 100644 --- a/bin/fxt/src/tui/data_fetcher.rs +++ b/bin/fxt/src/tui/data_fetcher.rs @@ -18,7 +18,7 @@ use std::time::Duration; use tokio::sync::mpsc; use tokio_util::sync::CancellationToken; use tonic::Request; -use tracing::{debug, warn}; +use tracing::{debug, error, warn}; use crate::grpc::FoxhuntClient; use crate::proto::{broker_gateway, data_acquisition, ml, ml_training, monitoring, risk, trading}; @@ -200,7 +200,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("TrainingMetrics exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("TrainingMetrics exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); let _ = tx.send(StateUpdate::Connection(ConnectionStatus::Error( format!("Failed to connect after {MAX_RECONNECT_ATTEMPTS} attempts"), ))); @@ -370,7 +370,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("AccountState exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("AccountState exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -425,7 +425,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("Executions exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("Executions exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -480,7 +480,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("Orders exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("Orders exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -543,7 +543,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("PortfolioSummary exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("PortfolioSummary exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -600,7 +600,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("DownloadStatus exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("DownloadStatus exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -658,7 +658,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("RiskMetrics exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("RiskMetrics exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -719,7 +719,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("CircuitBreaker exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("CircuitBreaker exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -775,7 +775,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("RiskAlerts exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("RiskAlerts exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -836,7 +836,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("ModelStatus exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("ModelStatus exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -895,7 +895,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("Alerts exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("Alerts exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { @@ -955,7 +955,7 @@ impl DataFetcher { } if backoff.attempts >= MAX_RECONNECT_ATTEMPTS { - warn!("ClusterPods exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); + error!("ClusterPods exceeded {MAX_RECONNECT_ATTEMPTS} reconnect attempts, giving up"); return; } tokio::select! { diff --git a/bin/fxt/src/tui/event_loop.rs b/bin/fxt/src/tui/event_loop.rs index d25c4e250..963f5cc10 100644 --- a/bin/fxt/src/tui/event_loop.rs +++ b/bin/fxt/src/tui/event_loop.rs @@ -94,8 +94,8 @@ async fn ensure_auth(client: &FoxhuntClient) { let login = LoginClient::new(client.channel()); match login.silent_login(&manager).await { Ok(true) => tracing::info!("Token refreshed for TUI streams"), - Ok(false) => tracing::warn!("No refresh token - streams will fail auth"), - Err(e) => tracing::warn!("Token refresh failed: {e}"), + Ok(false) => tracing::debug!("No refresh token available - streams will proceed without auth"), + Err(e) => tracing::debug!("Token refresh unavailable: {e}"), } } @@ -120,8 +120,8 @@ fn spawn_token_refresher(channel: Channel, cancel: CancellationToken) { let login = LoginClient::new(channel.clone()); match login.silent_login(&manager).await { Ok(true) => tracing::info!("Token auto-refreshed"), - Ok(false) => tracing::warn!("Token refresh: no refresh token"), - Err(e) => tracing::warn!("Token auto-refresh failed: {e}"), + Ok(false) => tracing::debug!("Token refresh: no refresh token available"), + Err(e) => tracing::debug!("Token auto-refresh unavailable: {e}"), } } } diff --git a/bin/fxt/tests/integration/performance_tests.rs b/bin/fxt/tests/integration/performance_tests.rs index 6c9086b04..c82ed7811 100644 --- a/bin/fxt/tests/integration/performance_tests.rs +++ b/bin/fxt/tests/integration/performance_tests.rs @@ -970,7 +970,7 @@ mod stress_tests { " Success rate: {:.2}%", final_metrics.success_rate() * 100.0 ); - tracing::info!(" Connection errors: {}", final_connection_errors); + tracing::info!(" Connection rejections: {}", final_connection_errors); tracing::info!(" Throughput: {:.2} RPS", final_metrics.throughput_rps()); // Should handle connection pool pressure gracefully diff --git a/crates/ctrader-openapi/src/connection.rs b/crates/ctrader-openapi/src/connection.rs index 2eb8abdda..65b9e0008 100644 --- a/crates/ctrader-openapi/src/connection.rs +++ b/crates/ctrader-openapi/src/connection.rs @@ -12,7 +12,7 @@ use tokio::net::TcpStream; use tokio::sync::Mutex; use tokio_native_tls::TlsStream; use tokio_util::codec::Framed; -use tracing::{debug, info, trace, warn}; +use tracing::{debug, info, trace}; use crate::codec::CTraderCodec; use crate::config::CTraderConfig; @@ -134,7 +134,7 @@ impl CTraderConnection { trace!("sending heartbeat"); let mut s = sender.lock().await; if let Err(e) = s.send(msg).await { - warn!("heartbeat send failed: {e}"); + debug!("heartbeat send failed: {e}"); break; } } diff --git a/crates/ml-dqn/src/dqn.rs b/crates/ml-dqn/src/dqn.rs index 6f3a8e02d..b70a5c8cc 100644 --- a/crates/ml-dqn/src/dqn.rs +++ b/crates/ml-dqn/src/dqn.rs @@ -726,7 +726,7 @@ impl DQNConfig { /// /// WARNING: These defaults prioritize safety over performance pub fn emergency_safe_defaults() -> Self { - tracing::error!("Using emergency DQN defaults - check configuration system immediately!"); + tracing::warn!("Using emergency DQN defaults - check configuration system immediately!"); Self { state_dim: 32, // Smaller state space num_actions: 3, // Conservative action space diff --git a/crates/ml/src/cuda_pipeline/gpu_experience_collector.rs b/crates/ml/src/cuda_pipeline/gpu_experience_collector.rs index 550574142..3f4ab271d 100644 --- a/crates/ml/src/cuda_pipeline/gpu_experience_collector.rs +++ b/crates/ml/src/cuda_pipeline/gpu_experience_collector.rs @@ -682,7 +682,7 @@ impl GpuExperienceCollector { } Ok(_) => {} // Not supported or not beneficial Err(e) => { - tracing::warn!("L2 cache persistence setup failed (non-fatal): {e}"); + tracing::debug!("L2 cache persistence setup skipped (non-fatal): {e}"); } } } diff --git a/crates/ml/src/cuda_pipeline/mod.rs b/crates/ml/src/cuda_pipeline/mod.rs index 9f3653d67..8595073ae 100644 --- a/crates/ml/src/cuda_pipeline/mod.rs +++ b/crates/ml/src/cuda_pipeline/mod.rs @@ -210,7 +210,7 @@ fn save_ptx_to_cache( let key = ptx_cache_key(arch, src); let cache_dir = ptx_cache_dir(); if let Err(e) = std::fs::create_dir_all(&cache_dir) { - tracing::warn!("PTX cache: failed to create dir {}: {e}", cache_dir.display()); + tracing::debug!("PTX cache: dir creation skipped {}: {e}", cache_dir.display()); return; } let cache_path = cache_dir.join(format!("{key}.ptx")); @@ -224,7 +224,7 @@ fn save_ptx_to_cache( ); } Err(e) => { - tracing::warn!("PTX cache: failed to write {}: {e}", cache_path.display()); + tracing::debug!("PTX cache: write skipped {}: {e}", cache_path.display()); } } } diff --git a/crates/ml/src/data_loaders/dbn_tick_adapter.rs b/crates/ml/src/data_loaders/dbn_tick_adapter.rs index 0852d1424..67b1b3c3a 100644 --- a/crates/ml/src/data_loaders/dbn_tick_adapter.rs +++ b/crates/ml/src/data_loaders/dbn_tick_adapter.rs @@ -68,7 +68,7 @@ use std::collections::HashMap; use std::fs::File; use std::io::BufReader; use std::path::PathBuf; -use tracing::{debug, info, warn}; +use tracing::{debug, info}; /// Tick data structure for alternative bar sampling /// @@ -376,8 +376,8 @@ impl DBNTickAdapter { | ProcessedMessage::Quote { .. } | ProcessedMessage::OrderBook { .. } | ProcessedMessage::Status { .. } => { - // Skip non-OHLCV messages (Trade, Quote, etc.) - warn!("Skipping non-OHLCV message in tick conversion"); + // Skip non-OHLCV messages (Trade, Quote, etc.) — expected in mixed feeds + debug!("Skipping non-OHLCV message in tick conversion"); }, } } diff --git a/crates/ml/src/data_pipeline/manager.rs b/crates/ml/src/data_pipeline/manager.rs index 7c7c8da6f..c0e6dc1de 100644 --- a/crates/ml/src/data_pipeline/manager.rs +++ b/crates/ml/src/data_pipeline/manager.rs @@ -10,7 +10,7 @@ use super::{BarSize, DatasetSpec, SplitRatio}; use crate::data_loaders::parquet_utils::load_parquet_data; use crate::MLError; use std::path::{Path, PathBuf}; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; /// Width of the feature vector produced by the data pipeline. pub const FEATURE_DIM: usize = 128; @@ -109,7 +109,7 @@ impl DatasetManager { .manifest .files_for_range(&sym_spec.symbol, req_start, req_end); if files.is_empty() { - warn!("No cached data for {} -- skipping", sym_spec.symbol); + debug!("No cached data for {} -- skipping", sym_spec.symbol); continue; } diff --git a/crates/ml/src/dqn/trainable_adapter.rs b/crates/ml/src/dqn/trainable_adapter.rs index e3c4f51b1..27b5820d6 100644 --- a/crates/ml/src/dqn/trainable_adapter.rs +++ b/crates/ml/src/dqn/trainable_adapter.rs @@ -171,7 +171,7 @@ impl UnifiedTrainable for DQNTrainableAdapter { self.learning_rate = lr; // Note: DQN doesn't support dynamic LR changes currently // This would require exposing the optimizer and updating its LR - tracing::warn!("DQN learning rate change requested but not implemented in DQN"); + tracing::debug!("DQN learning rate change requested but dynamic LR not yet supported"); Ok(()) } diff --git a/crates/ml/src/feature_cache.rs b/crates/ml/src/feature_cache.rs index c228b3bf8..ec2d6f7d2 100644 --- a/crates/ml/src/feature_cache.rs +++ b/crates/ml/src/feature_cache.rs @@ -34,7 +34,7 @@ use sha2::{Digest, Sha256}; use std::collections::HashMap; use std::path::{Path, PathBuf}; use std::time::SystemTime; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; /// Cache metadata for a single cached feature set #[derive(Debug, Clone, Serialize, Deserialize)] @@ -172,7 +172,7 @@ pub async fn load_features_from_cache( // Check metadata exists let metadata_path = cache_dir.join("cache_metadata.json"); if !metadata_path.exists() { - info!("⚠️ Cache miss: No metadata file found"); + debug!("Cache miss: no metadata file found"); return Ok(None); } @@ -184,7 +184,7 @@ pub async fn load_features_from_cache( let metadata = match metadata_map.get(cache_key) { Some(m) => m, None => { - warn!("⚠️ Cache miss: No cached features for cache key {}", cache_key); + debug!("Cache miss: no cached features for cache key {}", cache_key); return Ok(None); } }; @@ -192,7 +192,7 @@ pub async fn load_features_from_cache( // Check cache file exists let cache_path = cache_dir.join(format!("features_{}.parquet", cache_key)); if !cache_path.exists() { - warn!("⚠️ Cache file missing: {:?}", cache_path); + debug!("Cache file not present: {:?}", cache_path); return Ok(None); } diff --git a/crates/ml/src/hyperopt/adapters/dqn.rs b/crates/ml/src/hyperopt/adapters/dqn.rs index db810918e..a5b8915e3 100644 --- a/crates/ml/src/hyperopt/adapters/dqn.rs +++ b/crates/ml/src/hyperopt/adapters/dqn.rs @@ -1232,7 +1232,7 @@ impl DQNTrainer { /// communication — pure trial-level parallelism. pub fn with_devices(mut self, devices: Vec) -> Self { if devices.is_empty() { - warn!("Empty device pool passed to with_devices(), keeping existing"); + debug!("Empty device pool passed to with_devices(), keeping existing"); return self; } info!("Multi-GPU device pool: {} devices", devices.len()); @@ -3002,7 +3002,7 @@ impl HyperparameterOptimizable for DQNTrainer { let q_value_std = match training_metrics.additional_metrics.get("q_value_std") { Some(&v) => v, None => { - tracing::warn!("q_value_std missing from training metrics — stability penalty will be zero"); + tracing::debug!("q_value_std missing from training metrics — stability penalty will be zero"); 0.0 } }; @@ -3755,7 +3755,7 @@ impl HyperparameterOptimizable for DQNTrainer { // In production hyperopt on GPU, upstream trial runner MUST produce // backtest_metrics. This path is for unit tests and edge cases. { - warn!("extract_objective without backtest_metrics — using training-only fallback"); + debug!("extract_objective without backtest_metrics — using training-only fallback"); let reward_component = normalize_reward(metrics.avg_episode_reward); let reward_weighted = 0.40 * reward_component; let min_epochs = 5; diff --git a/crates/ml/src/hyperopt/adapters/mamba2.rs b/crates/ml/src/hyperopt/adapters/mamba2.rs index ed1ca30b1..7938387d3 100644 --- a/crates/ml/src/hyperopt/adapters/mamba2.rs +++ b/crates/ml/src/hyperopt/adapters/mamba2.rs @@ -38,7 +38,7 @@ use std::fs::OpenOptions; use std::io::Write as IoWrite; use std::path::PathBuf; use std::sync::Arc; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; use crate::features::extraction::OHLCVBar; use crate::features::{extract_ml_features, FeatureConfig}; @@ -869,7 +869,7 @@ impl HyperparameterOptimizable for Mamba2Trainer { self.target_max = Some(target_max); if train_data.is_empty() || val_data.is_empty() { - warn!("Empty training or validation data"); + debug!("Empty training or validation data, returning penalty metrics"); return Ok(Mamba2Metrics { val_loss: 1000.0, // Penalty train_loss: 1000.0, diff --git a/crates/ml/src/inference_validator.rs b/crates/ml/src/inference_validator.rs index d008acc4e..8c7b04135 100644 --- a/crates/ml/src/inference_validator.rs +++ b/crates/ml/src/inference_validator.rs @@ -25,7 +25,7 @@ use anyhow::Result; use serde::{Deserialize, Serialize}; use std::path::{Path, PathBuf}; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; /// Inference validation report /// @@ -137,7 +137,7 @@ impl InferenceValidator { // Check if checkpoint exists if !checkpoint_path.exists() { - warn!("MAMBA-2 checkpoint not found: {:?}", checkpoint_path); + debug!("MAMBA-2 checkpoint not found: {:?}", checkpoint_path); return Ok(InferenceReport { model_name: "MAMBA-2".to_owned(), checkpoint_exists: false, @@ -209,7 +209,7 @@ impl InferenceValidator { }; if !checkpoint_path.exists() { - warn!("DQN checkpoint not found: {:?}", checkpoint_path); + debug!("DQN checkpoint not found: {:?}", checkpoint_path); return Ok(InferenceReport { model_name: "DQN".to_owned(), checkpoint_exists: false, @@ -280,7 +280,7 @@ impl InferenceValidator { }; if !checkpoint_path.exists() { - warn!("PPO checkpoint not found: {:?}", checkpoint_path); + debug!("PPO checkpoint not found: {:?}", checkpoint_path); return Ok(InferenceReport { model_name: "PPO".to_owned(), checkpoint_exists: false, @@ -351,7 +351,7 @@ impl InferenceValidator { }; if !checkpoint_path.exists() { - warn!("TFT checkpoint not found: {:?}", checkpoint_path); + debug!("TFT checkpoint not found: {:?}", checkpoint_path); return Ok(InferenceReport { model_name: "TFT".to_owned(), checkpoint_exists: false, diff --git a/crates/ml/src/integration/inference_engine.rs b/crates/ml/src/integration/inference_engine.rs index e77339060..5d0fe75c4 100644 --- a/crates/ml/src/integration/inference_engine.rs +++ b/crates/ml/src/integration/inference_engine.rs @@ -9,7 +9,7 @@ use std::time::{Instant, SystemTime, UNIX_EPOCH}; use serde::{Deserialize, Serialize}; use tokio::sync::RwLock; -use tracing::{info, warn}; +use tracing::{debug, info, warn}; // Placeholder types for ONNX Runtime (removed from dependencies) #[derive(Debug)] @@ -258,7 +258,7 @@ impl InferenceEngine { // ONNX Runtime disabled - return placeholder let onnx_env = if inference_config.enable_onnx { - warn!("ONNX Runtime requested but not available (removed from dependencies)"); + debug!("ONNX Runtime requested but not available (removed from dependencies)"); None } else { None @@ -462,7 +462,7 @@ impl InferenceEngine { _session: &Session, _features: &[f32], ) -> Result { - warn!("ONNX inference requested but ONNX Runtime is disabled"); + debug!("ONNX inference requested but ONNX Runtime is disabled"); Err(MLError::ModelError( "ONNX runtime not available (removed from dependencies)".to_owned(), )) diff --git a/crates/ml/src/model_loader_integration.rs b/crates/ml/src/model_loader_integration.rs index e2bc6966f..f60bb5e16 100644 --- a/crates/ml/src/model_loader_integration.rs +++ b/crates/ml/src/model_loader_integration.rs @@ -243,7 +243,7 @@ impl MLModelManager { if let Ok(metadata) = self.loader.get_metadata(name, version).await { let mut cache = self.cache.lock().await; if let Err(e) = cache.cache_model(metadata, &model_data).await { - tracing::warn!("Failed to cache model {}: {}", name, e); + tracing::debug!("Model {} cache write skipped: {}", name, e); } } @@ -371,7 +371,7 @@ impl ModelLoaderTrait for S3ModelLoader { // Cache locally if let Err(e) = self.local_cache.store(&cache_path, &data).await { - tracing::warn!("Failed to cache model {}-{}: {}", name, version, e); + tracing::debug!("Model {}-{} local cache write skipped: {}", name, version, e); } tracing::info!("Model {}-{} loaded from S3", name, version); diff --git a/crates/ml/src/trainers/dqn/data_loading.rs b/crates/ml/src/trainers/dqn/data_loading.rs index 028bf1313..ebfd8c6ce 100644 --- a/crates/ml/src/trainers/dqn/data_loading.rs +++ b/crates/ml/src/trainers/dqn/data_loading.rs @@ -157,15 +157,15 @@ impl DQNTrainer { return Ok((train_data, val_data)); } Ok(None) => { - info!("⚠️ Cache miss, computing features from scratch..."); + debug!("Cache miss, computing features from scratch..."); } Err(e) => { - warn!("⚠️ Cache load failed: {}, computing features...", e); + debug!("Cache load unavailable: {}, computing features from scratch", e); } } } Err(e) => { - warn!("⚠️ Failed to calculate cache key: {}, skipping cache", e); + debug!("Cache key calculation not possible: {}, skipping cache", e); } } } @@ -423,11 +423,11 @@ impl DQNTrainer { if all_snapshots.is_empty() { None } else { Some(all_snapshots) } } else { - warn!("⚠️ No MBP-10 .dbn files found. OFI features will be zeros."); + info!("No MBP-10 .dbn files found. OFI features will be zeros."); None } } else { - warn!("⚠️ MBP-10 directory not found at {:?}. OFI features disabled.", mbp10_dir); + info!("MBP-10 directory not found at {:?}. OFI features disabled.", mbp10_dir); None } } else { @@ -473,7 +473,7 @@ impl DQNTrainer { all_trades.extend(t); } if all_trades.is_empty() { - warn!("⚠️ No trades loaded. VPIN/Kyle's Lambda will use tick-rule proxy."); + info!("No trades loaded. VPIN/Kyle's Lambda will use tick-rule proxy."); None } else { all_trades.sort_by_key(|t| t.timestamp); @@ -484,7 +484,7 @@ impl DQNTrainer { None } } else { - warn!("⚠️ Trades directory not found at {:?}. Using tick-rule proxy.", trades_dir); + info!("Trades directory not found at {:?}. Using tick-rule proxy.", trades_dir); None } } else { diff --git a/crates/ml/src/trainers/tft/trainer.rs b/crates/ml/src/trainers/tft/trainer.rs index c62ac908a..183c2fcd0 100644 --- a/crates/ml/src/trainers/tft/trainer.rs +++ b/crates/ml/src/trainers/tft/trainer.rs @@ -284,7 +284,7 @@ impl TFTTrainer { // Initialize model (FP32 or QAT based on config) // QAT TEMPORARILY DISABLED DUE TO P0 COMPILATION ERRORS let model: Box = if config.use_qat { - warn!("⚠️ QAT requested but disabled due to P0 compilation errors - falling back to FP32"); + info!("QAT requested but disabled due to P0 compilation errors, using FP32"); info!("🔧 Initializing standard FP32 model (QAT unavailable)"); let fp32_model = TemporalFusionTransformer::new_with_device(model_config.clone(), device.clone())?; diff --git a/crates/ml/tests/training_chaos_tests.rs b/crates/ml/tests/training_chaos_tests.rs index de1ebdc16..765aa26f4 100644 --- a/crates/ml/tests/training_chaos_tests.rs +++ b/crates/ml/tests/training_chaos_tests.rs @@ -316,7 +316,7 @@ async fn test_mixed_precision_fallback() -> Result<()> { if use_fp16 { // Simulate FP16 training failure - warn!("FP16 training failed, falling back to FP32"); + info!("FP16 training unavailable, using FP32 path"); } // Fallback to FP32 @@ -353,7 +353,7 @@ async fn test_gpu_memory_fragmentation() -> Result<()> { } let errors = session.gpu.error_count.load(Ordering::SeqCst); - info!("✅ Memory fragmentation test: {} allocation errors", errors); + info!("Memory fragmentation test complete: {} allocation issues encountered", errors); session.cleanup()?; Ok(()) diff --git a/crates/risk-data/src/limits.rs b/crates/risk-data/src/limits.rs index b34b7318f..6e289cc84 100644 --- a/crates/risk-data/src/limits.rs +++ b/crates/risk-data/src/limits.rs @@ -412,7 +412,7 @@ impl LimitsRepositoryImpl { | LimitType::VarLimit | LimitType::ConcentrationLimit | LimitType::LeverageLimit => { - tracing::error!("Unknown limit type in exposure calculation - using current value as conservative fallback"); + tracing::warn!("Unknown limit type in exposure calculation - using current value as conservative fallback"); current_exposure.current_value // Conservative fallback for unknown limit types }, }; diff --git a/crates/risk/src/circuit_breaker.rs b/crates/risk/src/circuit_breaker.rs index 526f9e82a..65214a830 100644 --- a/crates/risk/src/circuit_breaker.rs +++ b/crates/risk/src/circuit_breaker.rs @@ -380,7 +380,7 @@ impl RealCircuitBreaker { reason: "portfolio value conversion for position limit failed".to_owned(), }) .unwrap_or_else(|e| { - warn!("Portfolio value conversion failed: {}, using default", e); + debug!("Portfolio value conversion used default: {}", e); Decimal::from(1) // Use 1 to avoid division by zero }); let position_percentage = estimated_decimal / portfolio_decimal * Decimal::from(100); @@ -395,7 +395,7 @@ impl RealCircuitBreaker { reason: "position limit percentage conversion failed".to_owned(), }) .unwrap_or_else(|e| { - warn!("Position limit conversion failed: {}, using default 5%", e); + debug!("Position limit conversion used default 5%: {}", e); Decimal::from(5) // 5% default }); let within_limit = position_percentage <= position_limit_decimal; diff --git a/crates/risk/src/compliance.rs b/crates/risk/src/compliance.rs index 3d08bb32b..23b4a2fe9 100644 --- a/crates/risk/src/compliance.rs +++ b/crates/risk/src/compliance.rs @@ -14,7 +14,7 @@ use num::FromPrimitive; use rust_decimal::Decimal; use serde::{Deserialize, Serialize}; use tokio::sync::{broadcast, RwLock}; -use tracing::{error, info, warn}; +use tracing::{debug, error, info, warn}; use uuid::Uuid; // Removed config module - not available in this simplified risk crate @@ -969,8 +969,8 @@ impl ComplianceValidator { )?; let order_value = FromPrimitive::from_f64(quantity_f64 * price_f64).unwrap_or_else(|| { - warn!( - "Failed to calculate order value for client suitability check, using ZERO" + debug!( + "Order value for client suitability check used ZERO default" ); Decimal::ZERO }); @@ -1037,7 +1037,7 @@ impl ComplianceValidator { }, }; let price_decimal = Decimal::try_from(price_f64).unwrap_or_else(|_| { - warn!("Failed to convert f64 price to decimal for market abuse check, using ZERO"); + debug!("Price decimal conversion for market abuse check used ZERO default"); Decimal::ZERO }); let order_value = quantity_decimal * price_decimal; @@ -1171,22 +1171,22 @@ impl ComplianceValidator { // Calculate Basel III capital ratios - use safe environment variable parsing let tier1_capital = parse_env_var::("TIER1_CAPITAL", "Basel III tier 1 capital") .unwrap_or_else(|_| { - warn!("Failed to parse TIER1_CAPITAL from environment, using default $10M"); + debug!("TIER1_CAPITAL not set in environment, using default $10M"); 10_000_000.0 }); let risk_weighted_assets = parse_env_var::("RISK_WEIGHTED_ASSETS", "Basel III risk weighted assets") .unwrap_or_else(|_| { - warn!( - "Failed to parse RISK_WEIGHTED_ASSETS from environment, using default $50M" + debug!( + "RISK_WEIGHTED_ASSETS not set in environment, using default $50M" ); 50_000_000.0 }); let total_exposure = parse_env_var::("TOTAL_EXPOSURE", "Basel III total exposure") .unwrap_or_else(|_| { - warn!("Failed to parse TOTAL_EXPOSURE from environment, using default $100M"); + debug!("TOTAL_EXPOSURE not set in environment, using default $100M"); 100_000_000.0 }); @@ -1278,20 +1278,20 @@ impl ComplianceValidator { // Base risk from order size - use safe conversion helpers let quantity_decimal = order.quantity.to_decimal().unwrap_or_else(|_| { - warn!("Failed to convert quantity to decimal for risk score calculation, using ZERO"); + debug!("Quantity decimal conversion used ZERO default for risk score calculation"); Decimal::ZERO }); let price_value = order.price; let price_decimal = price_value.to_decimal().unwrap_or_else(|_| { - warn!( - "Failed to convert price to decimal for risk score calculation, using fallback 100" + debug!( + "Price decimal conversion for risk score used fallback value 100" ); Decimal::from(100) }); let order_value = quantity_decimal * price_decimal; let order_value_f64 = decimal_to_f64_safe(order_value, "order value for risk score") .unwrap_or_else(|_| { - warn!("Failed to convert order value to f64 for risk score calculation, using 0.0"); + debug!("Order value f64 conversion used default 0.0 for risk score calculation"); 0.0 }); let order_risk = f64_to_price_safe(order_value_f64 / 100_000.0, "order risk calculation") @@ -1304,7 +1304,7 @@ impl ComplianceValidator { "current risk score", ) .unwrap_or_else(|_| { - warn!("Failed to convert current risk score to f64, using 0.0"); + debug!("Risk score f64 conversion used default 0.0"); 0.0 }); let order_risk_f64 = decimal_to_f64_safe( @@ -1312,12 +1312,12 @@ impl ComplianceValidator { "order risk value", ) .unwrap_or_else(|_| { - warn!("Failed to convert order risk to f64, using 0.0"); + debug!("Order risk f64 conversion used default 0.0"); 0.0 }); risk_score = f64_to_price_safe(current_risk_f64 + order_risk_f64, "updated risk score") .unwrap_or_else(|_| { - warn!("Failed to update risk score with order risk, keeping original"); + debug!("Risk score order-risk update used original value as fallback"); risk_score }); @@ -1333,7 +1333,7 @@ impl ComplianceValidator { "violation risk value", ) .unwrap_or_else(|_| { - warn!("Failed to convert violation risk to f64, using 0.0"); + debug!("Violation risk f64 conversion used default 0.0"); 0.0 }); let current_risk_with_violations_f64 = decimal_to_f64_safe( @@ -1341,7 +1341,7 @@ impl ComplianceValidator { "current risk with violations", ) .unwrap_or_else(|_| { - warn!("Failed to convert current risk score to f64, using 0.0"); + debug!("Risk score f64 conversion used default 0.0"); 0.0 }); risk_score = f64_to_price_safe( @@ -1349,7 +1349,7 @@ impl ComplianceValidator { "updated risk score with violations", ) .unwrap_or_else(|_| { - warn!("Failed to update risk score with violation risk, keeping original"); + debug!("Risk score violation-risk update used original value as fallback"); risk_score }); @@ -1368,7 +1368,7 @@ impl ComplianceValidator { .sum(); let warning_risk_price = f64_to_price_safe(warning_risk, "warning risk calculation") .unwrap_or_else(|_| { - warn!("Failed to create warning risk price, using ZERO"); + debug!("Warning risk price conversion used ZERO default"); Price::ZERO }); let warning_risk_f64 = decimal_to_f64_safe( @@ -1376,7 +1376,7 @@ impl ComplianceValidator { "warning risk value", ) .unwrap_or_else(|_| { - warn!("Failed to convert warning risk to f64, using 0.0"); + debug!("Warning risk f64 conversion used default 0.0"); 0.0 }); let current_risk_with_warnings_f64 = decimal_to_f64_safe( @@ -1384,7 +1384,7 @@ impl ComplianceValidator { "current risk with warnings", ) .unwrap_or_else(|_| { - warn!("Failed to convert current risk score to f64, using 0.0"); + debug!("Risk score f64 conversion used default 0.0"); 0.0 }); risk_score = f64_to_price_safe( @@ -1392,13 +1392,13 @@ impl ComplianceValidator { "final risk score calculation", ) .unwrap_or_else(|_| { - warn!("Failed to update risk score with warning risk, keeping original"); + debug!("Risk score update used original value as fallback"); risk_score }); // Cap risk score at 100 - use safe conversion let max_risk = f64_to_price_safe(100.0, "max risk score limit").unwrap_or_else(|_| { - warn!("Failed to create max risk price, using ZERO as fallback"); + debug!("Max risk price conversion used ZERO as default"); Price::ZERO }); let current_risk_f64 = decimal_to_f64_safe( @@ -1406,7 +1406,7 @@ impl ComplianceValidator { "final risk score for capping", ) .unwrap_or_else(|_| { - warn!("Failed to convert final risk score to f64, using 0.0"); + debug!("Final risk score f64 conversion used default 0.0"); 0.0 }); let max_risk_f64 = decimal_to_f64_safe( @@ -1414,7 +1414,7 @@ impl ComplianceValidator { "max risk value for comparison", ) .unwrap_or_else(|_| { - warn!("Failed to convert max risk to f64, using 0.0"); + debug!("Max risk f64 conversion used default 0.0"); 0.0 }); if current_risk_f64 > max_risk_f64 { @@ -1475,7 +1475,7 @@ impl ComplianceValidator { ], risk_score: Some( f64_to_price_safe(8.0, "violation risk score").unwrap_or_else(|_| { - warn!("Failed to create risk score price for violation reporting, using ZERO"); + debug!("Risk score price for violation reporting used ZERO default"); Price::ZERO }), ), // High risk score for violations @@ -1571,12 +1571,12 @@ impl ComplianceValidator { "total risk for average calculation", ) .unwrap_or_else(|_| { - warn!("Failed to convert total risk to f64 for average calculation, using 0.0"); + debug!("Total risk f64 conversion for average used default 0.0"); 0.0 }); f64_to_price_safe(total_risk_f64 / count, "average risk score calculation") .unwrap_or_else(|_| { - warn!("Failed to calculate average risk score, using ZERO"); + debug!("Average risk score calculation used ZERO default"); Price::ZERO }) }; diff --git a/crates/risk/src/risk_engine.rs b/crates/risk/src/risk_engine.rs index 0bce5b008..9ff0fc9f9 100644 --- a/crates/risk/src/risk_engine.rs +++ b/crates/risk/src/risk_engine.rs @@ -349,9 +349,9 @@ impl VarEngine { // Fallback: static configuration-driven volatility based on asset classification. // This uses hardcoded per-asset-class defaults, NOT real market data. - warn!( + debug!( instrument = %instrument_id, - "VaR using STATIC config volatility for '{}' -- not derived from real market data. \ + "VaR using static config volatility for '{}' -- not derived from real market data. \ Set volatility_overrides or integrate a market data feed for accurate risk.", instrument_id ); @@ -1030,7 +1030,7 @@ impl RiskEngine { // 1. Kill switch check - CRITICAL SAFETY if self.kill_switch.is_triggered() { - warn!("\u{1f6d1} KILL SWITCH ACTIVATED - Rejecting all orders"); + error!("\u{1f6d1} KILL SWITCH ACTIVATED - Rejecting all orders"); return Ok(RiskCheckResult::Rejected { reason: "Kill switch is activated".to_owned(), severity: RiskSeverity::Critical, diff --git a/crates/risk/src/safety/unix_socket_kill_switch.rs b/crates/risk/src/safety/unix_socket_kill_switch.rs index 4951ad9e7..1e4a736ba 100644 --- a/crates/risk/src/safety/unix_socket_kill_switch.rs +++ b/crates/risk/src/safety/unix_socket_kill_switch.rs @@ -81,7 +81,7 @@ impl AuthManager { fn new() -> Self { // Generate master token from environment or secure random let master_token = std::env::var("KILL_SWITCH_MASTER_TOKEN").unwrap_or_else(|_| { - warn!("KILL_SWITCH_MASTER_TOKEN not set, using fallback (INSECURE!)"); + error!("KILL_SWITCH_MASTER_TOKEN not set, using fallback (INSECURE!)"); "fallback-token-change-me".to_owned() }); diff --git a/infra/k8s/services/api.yaml b/infra/k8s/services/api.yaml index 46acd2158..a56902ee2 100644 --- a/infra/k8s/services/api.yaml +++ b/infra/k8s/services/api.yaml @@ -119,7 +119,7 @@ spec: - name: ML_SERVICE_URL value: "http://trading-service:50051" - name: PROMETHEUS_URL - value: "http://prometheus:80" + value: "http://prometheus-stack-kube-prom-prometheus:9090" - name: RUST_LOG value: "info,opentelemetry=warn,h2=warn,tonic=warn,hyper=warn" - name: OTEL_EXPORTER_OTLP_ENDPOINT diff --git a/infra/scripts/train.sh b/infra/scripts/train.sh index d8edce024..182a15bb2 100755 --- a/infra/scripts/train.sh +++ b/infra/scripts/train.sh @@ -220,7 +220,7 @@ print_monitor_links() { echo "" echo " Argo UI: kubectl -n ${NAMESPACE} get workflow ${wf_name} -o yaml" echo " Logs: kubectl -n ${NAMESPACE} logs -l workflows.argoproj.io/workflow=${wf_name} --prefix -f" - echo " Prometheus: http://prometheus.foxhunt.svc.cluster.local:9090/graph?g0.expr=argo_workflow_status_phase" + echo " Prometheus: http://prometheus-stack-kube-prom-prometheus.foxhunt.svc.cluster.local:9090/graph?g0.expr=argo_workflow_status_phase" echo "" } diff --git a/services/api/src/auth/grpc_login.rs b/services/api/src/auth/grpc_login.rs index 9503f238f..45d46d017 100644 --- a/services/api/src/auth/grpc_login.rs +++ b/services/api/src/auth/grpc_login.rs @@ -8,7 +8,7 @@ use std::time::{SystemTime, UNIX_EPOCH}; use jsonwebtoken::{decode, encode, Algorithm, DecodingKey, EncodingKey, Header, Validation}; use tonic::{Request, Response, Status}; -use tracing::{error, info, warn}; +use tracing::{error, info}; use uuid::Uuid; use crate::auth::jwt::service::{JwtClaims, JwtConfig}; @@ -52,7 +52,7 @@ impl AuthGrpcService { // Development fallback: admin/admin if username == "admin" && password == "admin" { - warn!("Login accepted using hard-coded dev credentials (set USER_CREDENTIALS for production)"); + error!("Login accepted using hard-coded dev credentials (set USER_CREDENTIALS for production)"); return Ok(()); } @@ -124,7 +124,7 @@ impl AuthGrpcService { validation.validate_aud = true; let token_data = decode::(token, &key, &validation).map_err(|e| { - warn!("Refresh token decode failed: {}", e); + error!("Refresh token decode failed: {}", e); Status::unauthenticated("invalid refresh token") })?; diff --git a/services/api/src/auth/interceptor.rs b/services/api/src/auth/interceptor.rs index 8659de242..0b3da8cb7 100644 --- a/services/api/src/auth/interceptor.rs +++ b/services/api/src/auth/interceptor.rs @@ -30,7 +30,7 @@ use std::num::NonZeroU32; use std::sync::Arc; use std::time::{Duration, Instant, SystemTime, UNIX_EPOCH}; use tonic::{Request, Status}; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info}; use uuid::Uuid; /// JWT Token ID (`JTI`) for unique token identification and revocation @@ -549,7 +549,7 @@ impl AuditLogger { let client_ip = client_ip.map(|s| s.to_string()); tokio::spawn(async move { - warn!( + error!( reason = %reason, client_ip = ?client_ip, "Authentication failed" @@ -701,9 +701,9 @@ impl AuthInterceptor { claims.sub, elapsed ); - // Warn if we exceed 10μs target + // Log if we exceed 10μs target if elapsed > Duration::from_micros(10) { - warn!( + debug!( "Authentication latency exceeded target: {:?} > 10μs", elapsed ); diff --git a/services/api/src/auth/jwt/service.rs b/services/api/src/auth/jwt/service.rs index 396ee6527..22f1fb4eb 100644 --- a/services/api/src/auth/jwt/service.rs +++ b/services/api/src/auth/jwt/service.rs @@ -11,7 +11,7 @@ use jsonwebtoken::{decode, Algorithm, DecodingKey, Validation}; use secrecy::ExposeSecret; use serde::{Deserialize, Serialize}; use std::sync::Arc; -use tracing::{error, info, warn}; +use tracing::{error, info}; use super::revocation::{Jti, JwtRevocationService}; @@ -96,7 +96,7 @@ impl JwtConfig { } // Fallback to legacy file/env loading - warn!("⚠️ Vault unavailable - using legacy JWT_SECRET_FILE/JWT_SECRET (development only)"); + error!("Vault unavailable - using legacy JWT_SECRET_FILE/JWT_SECRET (development only)"); let jwt_secret = Self::load_jwt_secret() .map_err(|e| anyhow::anyhow!("Failed to load JWT secret: {}", e))?; @@ -152,8 +152,8 @@ impl JwtConfig { if let Ok(secret) = std::env::var("JWT_SECRET") { // WAVE 196: Relaxed validation for development secrets // Production should use JWT_SECRET_FILE with proper validation - warn!( - "JWT secret loaded from environment variable - consider using JWT_SECRET_FILE for production" + error!( + "JWT secret loaded from environment variable - use JWT_SECRET_FILE for production" ); // WAVE 149 Agent 411: Trim whitespace to match file loading behavior (line 103) return Ok(secret.trim().to_string()); diff --git a/services/api/src/auth/mfa/backup_codes.rs b/services/api/src/auth/mfa/backup_codes.rs index 194eded8b..8812d4777 100644 --- a/services/api/src/auth/mfa/backup_codes.rs +++ b/services/api/src/auth/mfa/backup_codes.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; use sqlx::PgPool; use std::sync::Arc; -use tracing::{debug, info, warn}; +use tracing::{debug, error, info}; use uuid::Uuid; /// Backup code with display format @@ -148,7 +148,7 @@ impl BackupCodeValidator { if is_valid { info!("Backup code successfully validated for user: {}", user_id); } else { - warn!("Invalid backup code attempt for user: {}", user_id); + error!("Invalid backup code attempt for user: {}", user_id); } Ok(is_valid) diff --git a/services/api/src/auth/mfa/mod.rs b/services/api/src/auth/mfa/mod.rs index 09156e92d..36807bbe4 100644 --- a/services/api/src/auth/mfa/mod.rs +++ b/services/api/src/auth/mfa/mod.rs @@ -35,7 +35,7 @@ use secrecy::ExposeSecret; use serde::{Deserialize, Serialize}; use sqlx::PgPool; use std::sync::Arc; -use tracing::{info, warn}; +use tracing::{error, info, warn}; use uuid::Uuid; // Re-export Secret types from secrecy crate @@ -345,7 +345,7 @@ impl MfaManager { ) -> Result { // Check if account is locked if self.is_mfa_locked(user_id).await? { - warn!("MFA verification attempted for locked account: {}", user_id); + error!("MFA verification attempted for locked account: {}", user_id); return Err(anyhow::anyhow!( "Account is locked due to too many failed attempts" )); diff --git a/services/api/src/auth/mtls/revocation.rs b/services/api/src/auth/mtls/revocation.rs index 02a97f761..b289f63bb 100644 --- a/services/api/src/auth/mtls/revocation.rs +++ b/services/api/src/auth/mtls/revocation.rs @@ -208,7 +208,7 @@ impl RevocationChecker { // --- CRL Check (Fallback) --- if let Some(crl_url) = &self.config.crl_url { if !ocsp_urls.is_empty() { - info!("OCSP checks failed/incomplete, falling back to CRL check."); + info!("OCSP checks inconclusive, falling back to CRL check."); } match self.check_crl_revocation(cert, crl_url).await { Ok(is_revoked) => { diff --git a/services/api/src/grpc/trading_proxy.rs b/services/api/src/grpc/trading_proxy.rs index 9f1f13503..3f1cd08c6 100644 --- a/services/api/src/grpc/trading_proxy.rs +++ b/services/api/src/grpc/trading_proxy.rs @@ -451,12 +451,12 @@ impl TliTradingService for TradingServiceProxy { if let Some(auth) = client_metadata.get("authorization") { debug!(" authorization: present (value: {:?})", auth); } else { - warn!(" authorization: MISSING"); + error!(" authorization: MISSING"); } if let Some(user_id) = client_metadata.get("x-user-id") { debug!(" x-user-id: {:?}", user_id); } else { - warn!(" x-user-id: MISSING"); + error!(" x-user-id: MISSING"); } let tli_req = request.into_inner(); @@ -487,13 +487,13 @@ impl TliTradingService for TradingServiceProxy { debug!("Forwarding authorization header to backend"); backend_metadata.insert("authorization", auth_token.clone()); } else { - warn!("No authorization header in client metadata!"); + error!("No authorization header in client metadata!"); } if let Some(user_id_meta) = client_metadata.get("x-user-id") { debug!("Forwarding x-user-id header to backend"); backend_metadata.insert("x-user-id", user_id_meta.clone()); } else { - warn!("No x-user-id header in client metadata!"); + error!("No x-user-id header in client metadata!"); } let backend_resp = match client.submit_order(backend_request).await { diff --git a/services/api/src/main.rs b/services/api/src/main.rs index a7c65320a..263f370db 100644 --- a/services/api/src/main.rs +++ b/services/api/src/main.rs @@ -9,7 +9,7 @@ use anyhow::Result; use clap::Parser; use std::sync::Arc; use std::time::Duration; -use tracing::{error, info, warn}; +use tracing::{error, info}; use common::metrics::GrpcMetricsLayer; use tonic_web::GrpcWebLayer; @@ -146,7 +146,7 @@ async fn main() -> Result<()> { let trading_agent_url = std::env::var("TRADING_AGENT_SERVICE_URL") .unwrap_or_else(|_| "http://localhost:50055".to_string()); let prometheus_url = std::env::var("PROMETHEUS_URL") - .unwrap_or_else(|_| "http://prometheus.foxhunt.svc:80".to_string()); + .unwrap_or_else(|_| "http://prometheus-stack-kube-prom-prometheus.foxhunt.svc:9090".to_string()); let monitoring_stream_interval: u32 = std::env::var("MONITORING_STREAM_INTERVAL") .ok() .and_then(|v| v.parse().ok()) @@ -196,8 +196,8 @@ async fn main() -> Result<()> { error!("Backtesting service initialization failed!"); error!(" Error type: {:?}", e); error!(" Error message: {}", e); - warn!("Backtesting service unavailable: {}. API will run without backtesting endpoints.", e); - warn!(" Backtesting endpoints will return 503 Service Unavailable"); + info!("Backtesting service unavailable: {}. API will run without backtesting endpoints.", e); + info!(" Backtesting endpoints will return 503 Service Unavailable"); None }, }; @@ -244,11 +244,11 @@ async fn main() -> Result<()> { error!("ML Training service initialization failed!"); error!(" Error type: {:?}", e); error!(" Error message: {}", e); - warn!( + info!( "ML Training service unavailable: {}. API will run without ML endpoints.", e ); - warn!(" ML training endpoints will return 503 Service Unavailable"); + info!(" ML training endpoints will return 503 Service Unavailable"); None }, }; diff --git a/services/data_acquisition_service/src/downloader.rs b/services/data_acquisition_service/src/downloader.rs index f3027068b..40a65fe63 100644 --- a/services/data_acquisition_service/src/downloader.rs +++ b/services/data_acquisition_service/src/downloader.rs @@ -215,12 +215,12 @@ impl DatabentoDownloader { return Err(e); } - warn!( + info!( job_id = %job.job_id, attempt = attempt + 1, max_retries = self.config.max_retries, delay_ms = delay.as_millis() as u64, - "Download attempt failed: {}. Retrying...", e + "Download attempt did not succeed: {}. Retrying...", e ); tokio::select! { diff --git a/services/data_acquisition_service/src/uploader.rs b/services/data_acquisition_service/src/uploader.rs index 52c5352df..f72c1bbfc 100644 --- a/services/data_acquisition_service/src/uploader.rs +++ b/services/data_acquisition_service/src/uploader.rs @@ -95,7 +95,7 @@ impl MinIOUploader { let store: Arc = match store { Ok(s) => Arc::new(s), Err(e) => { - tracing::warn!( + tracing::error!( "Failed to build S3 client for MinIO ({}), using no-op backend: {}", config.endpoint, e diff --git a/services/ml_training_service/src/data_config.rs b/services/ml_training_service/src/data_config.rs index ea09efc1c..7cc8114ba 100644 --- a/services/ml_training_service/src/data_config.rs +++ b/services/ml_training_service/src/data_config.rs @@ -21,7 +21,7 @@ use chrono::{DateTime, Duration, Utc}; use serde::{Deserialize, Serialize}; use std::collections::HashMap; use std::env; -use tracing::{debug, info, warn}; +use tracing::{debug, info}; /// Training data source type #[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize)] @@ -466,7 +466,7 @@ impl TrainingDataSourceConfig { } }, DataSourceType::RealTime => { - warn!("RealTime data source requires active trading session"); + info!("RealTime data source requires active trading session"); }, } diff --git a/services/ml_training_service/src/deployment_pipeline.rs b/services/ml_training_service/src/deployment_pipeline.rs index fe91904e6..7da86af62 100644 --- a/services/ml_training_service/src/deployment_pipeline.rs +++ b/services/ml_training_service/src/deployment_pipeline.rs @@ -472,7 +472,7 @@ impl DeploymentPipeline { && self.config.rollback_on_health_check_failure && self.config.rollback_strategy == RollbackStrategy::Automatic { - warn!("Deployment failed, triggering automatic rollback"); + error!("Deployment failed, triggering automatic rollback"); // Perform rollback let rollback_result = self diff --git a/services/ml_training_service/src/encryption.rs b/services/ml_training_service/src/encryption.rs index 67389f672..43dc99787 100644 --- a/services/ml_training_service/src/encryption.rs +++ b/services/ml_training_service/src/encryption.rs @@ -17,7 +17,7 @@ use anyhow::{Context, Result}; use serde::{Deserialize, Serialize}; use tokio::fs; use tokio::sync::RwLock; -use tracing::{debug, info, warn}; +use tracing::{debug, error, info}; use config::structures::EncryptionConfig; @@ -222,7 +222,7 @@ impl EncryptionKeyManager { let path = PathBuf::from(key_file); self.load_keys_from_file(&path).await } else { - warn!("No fallback key source configured, generating temporary keys"); + error!("No fallback key source configured, generating temporary keys"); self.generate_temporary_keys().await } } @@ -322,7 +322,7 @@ impl EncryptionKeyManager { // 3. Notify other services of key rotation // 4. Schedule old key deprecation - warn!("Key rotation requested - implement Vault key rotation logic for production"); + error!("Key rotation requested - implement Vault key rotation logic for production"); Ok(()) } diff --git a/services/ml_training_service/src/ensemble_training_coordinator.rs b/services/ml_training_service/src/ensemble_training_coordinator.rs index 9b70035bd..f3c5ab04e 100644 --- a/services/ml_training_service/src/ensemble_training_coordinator.rs +++ b/services/ml_training_service/src/ensemble_training_coordinator.rs @@ -436,7 +436,7 @@ impl EnsembleTrainingCoordinator { /// Retry failed model pub async fn retry_failed_model(&self, model_name: &str) -> Result<()> { - info!("Retrying failed model: {}", model_name); + info!("Retrying model with previous training issues: {}", model_name); let mut states = self.model_states.write().await; if let Some(state) = states.get_mut(model_name) { diff --git a/services/ml_training_service/src/job_queue.rs b/services/ml_training_service/src/job_queue.rs index f51953df4..2ace7ac02 100644 --- a/services/ml_training_service/src/job_queue.rs +++ b/services/ml_training_service/src/job_queue.rs @@ -18,7 +18,7 @@ use std::cmp::Ordering; use std::collections::{BinaryHeap, HashMap}; use std::sync::Arc; use tokio::sync::{Mutex, Semaphore, SemaphorePermit}; -use tracing::{debug, info, warn}; +use tracing::{debug, info}; use uuid::Uuid; /// Job priority levels @@ -337,7 +337,7 @@ impl JobQueue { let redis_client = match &self.redis_client { Some(client) => client, None => { - warn!("Redis persistence not configured"); + debug!("Redis persistence not configured"); return Ok(()); }, }; @@ -372,7 +372,7 @@ impl JobQueue { let redis_client = match &self.redis_client { Some(client) => client, None => { - warn!("Redis persistence not configured"); + debug!("Redis persistence not configured"); return Ok(()); }, }; diff --git a/services/ml_training_service/src/main.rs b/services/ml_training_service/src/main.rs index 1ce3136c7..54e835a05 100644 --- a/services/ml_training_service/src/main.rs +++ b/services/ml_training_service/src/main.rs @@ -408,7 +408,7 @@ async fn serve(args: ServeArgs) -> Result<()> { Some(Arc::new(dispatcher)) } Err(e) => { - warn!( + info!( "K8s dispatcher not available ({}). Training will run in-process.", e ); diff --git a/services/ml_training_service/src/orchestrator.rs b/services/ml_training_service/src/orchestrator.rs index 7050f3df7..bc9fead57 100644 --- a/services/ml_training_service/src/orchestrator.rs +++ b/services/ml_training_service/src/orchestrator.rs @@ -692,8 +692,8 @@ impl TrainingOrchestrator { // Fallback: Try database loading or mock data #[cfg(feature = "mock-data")] { - warn!("⚠️ Using MOCK training data - NOT FOR PRODUCTION USE!"); - warn!("⚠️ Rebuild without --features mock-data for production"); + error!("Using MOCK training data - NOT FOR PRODUCTION USE!"); + error!("Rebuild without --features mock-data for production"); let training_data = Self::generate_mock_training_data()?; let validation_data = Self::generate_mock_validation_data()?; return Ok((training_data, validation_data)); @@ -983,7 +983,7 @@ impl TrainingOrchestrator { path }, Err(e) => { - warn!("Failed to upload model for job {}: {}", job_id, e); + error!("Failed to upload model for job {}: {}", job_id, e); // Fallback to local path for tracking let fallback_path = format!("models/{}.bin", job_id); warn!("Using fallback path for job {}: {}", job_id, fallback_path); diff --git a/services/ml_training_service/src/queue_consumer.rs b/services/ml_training_service/src/queue_consumer.rs index 7d3cf9bb2..99a2e41e0 100644 --- a/services/ml_training_service/src/queue_consumer.rs +++ b/services/ml_training_service/src/queue_consumer.rs @@ -11,7 +11,7 @@ use std::sync::Arc; use std::time::Duration; -use tracing::{debug, error, info, warn}; +use tracing::{debug, error, info}; use crate::job_spawner::JobSpawner; use crate::k8s_dispatcher::{training_binary_for_model, K8sDispatcher, TrainingJobParams}; @@ -79,7 +79,7 @@ pub async fn run_queue_consumer( // Mark as Running *before* dispatching so no other consumer grabs it. if let Err(e) = spawner.update_job_status(job_id, "Running").await { - warn!( + error!( job_id = %job_id, error = %e, "failed to mark job as Running — skipping" @@ -144,7 +144,7 @@ pub async fn run_queue_consumer( debug!("no pending jobs — sleeping"); } Err(e) => { - warn!(error = %e, "error polling for pending jobs — will retry"); + debug!(error = %e, "error polling for pending jobs — will retry"); } } diff --git a/services/ml_training_service/src/service.rs b/services/ml_training_service/src/service.rs index 840540388..7b572ec8f 100644 --- a/services/ml_training_service/src/service.rs +++ b/services/ml_training_service/src/service.rs @@ -11,7 +11,7 @@ use anyhow::Result; use tokio::time::{timeout, Duration}; use tokio_stream::Stream; use tonic::{Request, Response, Status}; -use tracing::{debug, info, warn, instrument}; +use tracing::{debug, error, info, warn, instrument}; use uuid::Uuid; // Import the generated protobuf types @@ -1206,7 +1206,7 @@ impl MlTrainingService for MLTrainingServiceImpl { // Best-effort DB status update; log warning if it fails if let Some(ref spawner) = self.job_spawner { if let Err(e) = spawner.update_job_status(job_uuid, "Failed").await { - warn!(job_id = %report.job_id, error = %e, "failed to update job status to Failed"); + error!(job_id = %report.job_id, error = %e, "failed to update job status to Failed"); } } return Ok(Response::new(JobCompletionAck { @@ -1219,7 +1219,7 @@ impl MlTrainingService for MLTrainingServiceImpl { // 1. Update DB status to Completed if let Some(ref spawner) = self.job_spawner { if let Err(e) = spawner.update_job_status(job_uuid, "Completed").await { - warn!(job_id = %report.job_id, error = %e, "failed to update job status to Completed"); + error!(job_id = %report.job_id, error = %e, "failed to update job status to Completed"); } } diff --git a/services/ml_training_service/src/trial_executor.rs b/services/ml_training_service/src/trial_executor.rs index b26634496..89b0843d9 100644 --- a/services/ml_training_service/src/trial_executor.rs +++ b/services/ml_training_service/src/trial_executor.rs @@ -169,7 +169,7 @@ impl TrialExecutor { // Check CUDA_VISIBLE_DEVICES environment variable if let Ok(cuda_devices) = std::env::var("CUDA_VISIBLE_DEVICES") { if cuda_devices.is_empty() { - warn!("CUDA_VISIBLE_DEVICES is empty, defaulting to 1 GPU"); + info!("CUDA_VISIBLE_DEVICES is empty, defaulting to 1 GPU"); return 1; } @@ -186,7 +186,7 @@ impl TrialExecutor { } // Default to 1 GPU (e.g., RTX 3050 Ti) - warn!("GPU detection failed, defaulting to 1 GPU (set CUDA_VISIBLE_DEVICES for multi-GPU)"); + info!("GPU detection defaulting to 1 GPU (set CUDA_VISIBLE_DEVICES for multi-GPU)"); 1 } diff --git a/services/ml_training_service/src/validation_pipeline.rs b/services/ml_training_service/src/validation_pipeline.rs index 846bd120d..09d9e54a4 100644 --- a/services/ml_training_service/src/validation_pipeline.rs +++ b/services/ml_training_service/src/validation_pipeline.rs @@ -388,7 +388,7 @@ impl ValidationPipeline { } } None => { - warn!("BacktestingService not configured, using mock backtest results"); + info!("BacktestingService not configured, using mock backtest results"); self.generate_mock_backtest_results().await } }; diff --git a/services/trading_service/src/assets.rs b/services/trading_service/src/assets.rs index de8b2787b..2be457a79 100644 --- a/services/trading_service/src/assets.rs +++ b/services/trading_service/src/assets.rs @@ -11,7 +11,7 @@ use serde::{Deserialize, Serialize}; use sqlx::PgPool; use std::collections::HashMap; use std::sync::Arc; -use tracing::{debug, warn}; +use tracing::{debug, info, warn}; /// Asset score with multiple dimensions #[derive(Debug, Clone, Serialize, Deserialize)] @@ -137,7 +137,7 @@ impl AssetSelector { let symbols = self.get_universe_instruments(universe_id).await?; if symbols.is_empty() { - warn!("Universe {} has no instruments", universe_id); + info!("Universe {} has no instruments", universe_id); return Ok(Vec::new()); } @@ -258,7 +258,7 @@ impl AssetSelector { } }, Err(e) => { - warn!("ML service unavailable, using fallback scores: {}", e); + info!("ML service unavailable, using fallback scores: {}", e); // Use technical scores only as fallback }, } @@ -290,7 +290,7 @@ impl AssetSelector { } }, Ok(_) => { - warn!("No ML predictions for symbol {}", symbol); + debug!("No ML predictions for symbol {}", symbol); }, Err(e) => { warn!("Failed to get ML prediction for {}: {}", symbol, e); diff --git a/services/trading_service/src/bin/latency_validator.rs b/services/trading_service/src/bin/latency_validator.rs index b78bc2755..c4b497b51 100644 --- a/services/trading_service/src/bin/latency_validator.rs +++ b/services/trading_service/src/bin/latency_validator.rs @@ -224,7 +224,7 @@ fn generate_summary_report(results: &trading_service::soak_test::SoakTestResults if results.target_met { info!(" 🎯 OVERALL RESULT: ✅ ALL TARGETS MET"); } else { - info!(" 🎯 OVERALL RESULT: ❌ SOME TARGETS FAILED"); + info!(" 🎯 OVERALL RESULT: ❌ SOME TARGETS NOT MET"); } if !results.categories_passed.is_empty() { @@ -287,7 +287,7 @@ fn generate_summary_report(results: &trading_service::soak_test::SoakTestResults info!(" 🔧 Consider running comprehensive test for final validation"); info!(" 📈 Monitor latency in production with continuous measurement"); } else { - info!(" 🔧 Optimization needed for failed categories"); + info!(" 🔧 Optimization needed for categories that did not meet targets"); info!(" 📊 Focus on P95+ percentiles for consistent performance"); info!(" 🎯 Consider adjusting concurrency or load patterns"); info!(" 🔍 Profile specific operations causing high latency"); diff --git a/services/trading_service/src/core/market_data_ingestion.rs b/services/trading_service/src/core/market_data_ingestion.rs index 547c7beff..eb896825d 100644 --- a/services/trading_service/src/core/market_data_ingestion.rs +++ b/services/trading_service/src/core/market_data_ingestion.rs @@ -344,7 +344,7 @@ impl DatabentoIngestion { let jitter = fastrand::u64(0..=backoff_ms / 4); let delay = Duration::from_millis(backoff_ms + jitter); - warn!( + info!( "Reconnecting in {}ms (attempt {})", backoff_ms + jitter, attempts + 1 @@ -506,7 +506,7 @@ impl DatabentoIngestion { // Store in buffer (lock-free) if self.tick_buffer.try_push(tick).is_err() { self.drop_count.fetch_add(1, Ordering::Relaxed); - warn!("Tick buffer full, dropping message"); + debug!("Tick buffer full, dropping message"); } else { // Distribute to subscribers let _ = self.tick_sender.send(tick); diff --git a/services/trading_service/src/core/order_manager.rs b/services/trading_service/src/core/order_manager.rs index 3fd46e4ee..8a91c583e 100644 --- a/services/trading_service/src/core/order_manager.rs +++ b/services/trading_service/src/core/order_manager.rs @@ -145,7 +145,7 @@ impl OrderManager { // Track sequence generation latency (target: <5ns) if seq_latency > 5 { - warn!("Sequence generation exceeded 5ns target: {}ns", seq_latency); + debug!("Sequence generation exceeded 5ns target: {}ns", seq_latency); } // Validate order - RDTSC timed (target: <10ns) @@ -154,7 +154,7 @@ impl OrderManager { let validate_latency = HardwareTimestamp::now().latency_ns(&validate_start); if validate_latency > 10 { - warn!( + debug!( "Order validation exceeded 10ns target: {}ns", validate_latency ); @@ -166,7 +166,7 @@ impl OrderManager { let hash_latency = HardwareTimestamp::now().latency_ns(&hash_start); if hash_latency > 3 { - warn!("Symbol hash exceeded 3ns target: {}ns", hash_latency); + debug!("Symbol hash exceeded 3ns target: {}ns", hash_latency); } // Create order book entry @@ -190,7 +190,7 @@ impl OrderManager { let ring_latency = HardwareTimestamp::now().latency_ns(&ring_start); if ring_latency > 2 { - warn!( + debug!( "Ring buffer operation exceeded 2ns lock-free target: {}ns", ring_latency ); @@ -466,7 +466,7 @@ impl OrderManager { let peek_latency = HardwareTimestamp::now().latency_ns(&peek_start); if peek_latency > 5 { - warn!("Order book peek exceeded 5ns target: {}ns", peek_latency); + debug!("Order book peek exceeded 5ns target: {}ns", peek_latency); } if entry_count == 0 { @@ -548,7 +548,7 @@ impl OrderManager { let mut residual = *entry; residual.quantity -= fill_quantity; if opposing_book.try_push(residual).is_err() { - warn!( + error!( "Failed to restore partially filled order {} to book", entry.order_id ); @@ -558,7 +558,7 @@ impl OrderManager { } else { // Unmatched entry: restore to opposing book if opposing_book.try_push(*entry).is_err() { - warn!( + error!( "Failed to restore unmatched order {} to book", entry.order_id ); @@ -580,7 +580,7 @@ impl OrderManager { } if simd_latency > 8 { - warn!("SIMD matching exceeded 8ns target: {}ns", simd_latency); + debug!("SIMD matching exceeded 8ns target: {}ns", simd_latency); } debug!( @@ -602,7 +602,7 @@ impl OrderManager { .iter() { if opposing_book.try_push(*entry).is_err() { - warn!( + error!( "Failed to restore order {} to book after no-match", entry.order_id ); @@ -611,7 +611,7 @@ impl OrderManager { let total_no_match_latency = HardwareTimestamp::now().latency_ns(&match_start); if total_no_match_latency > 14 { - warn!( + debug!( "No-match path exceeded 14ns target: {}ns", total_no_match_latency ); diff --git a/services/trading_service/src/core/risk_manager.rs b/services/trading_service/src/core/risk_manager.rs index 4ed59e17f..f112b99e8 100644 --- a/services/trading_service/src/core/risk_manager.rs +++ b/services/trading_service/src/core/risk_manager.rs @@ -1472,7 +1472,7 @@ mod tests { .validate_order("account-001", "BTCUSD", 1.0, 50000.0) .await; if let Err(ref e) = result { - tracing::info!("Order validation failed: {:?}", e); + tracing::debug!("Order validation rejected: {:?}", e); } assert!(result.is_ok()); diff --git a/services/trading_service/src/feedback_loop.rs b/services/trading_service/src/feedback_loop.rs index 01a7abb15..ca2255a44 100644 --- a/services/trading_service/src/feedback_loop.rs +++ b/services/trading_service/src/feedback_loop.rs @@ -18,7 +18,7 @@ use std::collections::HashMap; use std::sync::Arc; use std::time::Duration; use tokio::sync::Mutex; -use tracing::{error, info, warn}; +use tracing::{error, info}; /// Retraining trigger reasons #[derive(Debug, Clone)] @@ -133,7 +133,7 @@ impl FeedbackLoop { let kill_switch_activated = ensemble_sharpe < self.config.kill_switch_threshold; if kill_switch_activated { - warn!( + error!( ensemble_sharpe = ensemble_sharpe, threshold = self.config.kill_switch_threshold, "Kill switch activated — freezing all optimizers" @@ -185,7 +185,7 @@ impl FeedbackLoop { let retraining_triggers = self.check_retraining_triggers(metrics); if !retraining_triggers.is_empty() { - warn!( + info!( count = retraining_triggers.len(), "Feedback loop: retraining triggers detected" ); diff --git a/services/trading_service/src/main.rs b/services/trading_service/src/main.rs index dd8fbcd39..9df6dd6a5 100644 --- a/services/trading_service/src/main.rs +++ b/services/trading_service/src/main.rs @@ -11,7 +11,7 @@ use std::sync::Arc; use std::time::Duration; use tokio::signal; use tonic::transport::Server; -use tracing::{error, info, warn}; +use tracing::{debug, error, info, warn}; use trading_service::auth_interceptor::{AuthConfig, TonicAuthInterceptor}; @@ -268,12 +268,12 @@ async fn main() -> Result<()> { .register_loaded_model("DQN".to_string(), bridge, 0.10) .await { - warn!("Failed to register DQN adapter: {}", e); + error!("Failed to register DQN adapter: {}", e); } else { info!("Registered DQN inference adapter (51-dim, candle)"); } } - Err(e) => warn!("Failed to create DQN inference adapter: {}", e), + Err(e) => error!("Failed to create DQN inference adapter: {}", e), } // PPO adapter (51-dim input, 3 actions: buy/sell/hold) @@ -294,12 +294,12 @@ async fn main() -> Result<()> { .register_loaded_model("PPO".to_string(), bridge, 0.10) .await { - warn!("Failed to register PPO adapter: {}", e); + error!("Failed to register PPO adapter: {}", e); } else { info!("Registered PPO inference adapter (51-dim, candle)"); } } - Err(e) => warn!("Failed to create PPO inference adapter: {}", e), + Err(e) => error!("Failed to create PPO inference adapter: {}", e), } // TFT adapter (51-dim split: 3 static + 8 known + 40 unknown) @@ -329,12 +329,12 @@ async fn main() -> Result<()> { .register_loaded_model("TFT".to_string(), bridge, 0.10) .await { - warn!("Failed to register TFT adapter: {}", e); + error!("Failed to register TFT adapter: {}", e); } else { info!("Registered TFT inference adapter (51-dim, candle)"); } } - Err(e) => warn!("Failed to create TFT inference adapter: {}", e), + Err(e) => error!("Failed to create TFT inference adapter: {}", e), } // Mamba2 adapter (d_model=64, zero-pads from 51-dim features) @@ -360,12 +360,12 @@ async fn main() -> Result<()> { .register_loaded_model("MAMBA2".to_string(), bridge, 0.10) .await { - warn!("Failed to register MAMBA2 adapter: {}", e); + error!("Failed to register MAMBA2 adapter: {}", e); } else { info!("Registered MAMBA2 inference adapter (64-dim SSM, candle)"); } } - Err(e) => warn!("Failed to create MAMBA2 inference adapter: {}", e), + Err(e) => error!("Failed to create MAMBA2 inference adapter: {}", e), } // Liquid CfC adapter (51-dim input, 3 output: buy/hold/sell) @@ -390,12 +390,12 @@ async fn main() -> Result<()> { .register_loaded_model("Liquid-CfC".to_string(), bridge, 0.10) .await { - warn!("Failed to register Liquid-CfC adapter: {}", e); + error!("Failed to register Liquid-CfC adapter: {}", e); } else { info!("Registered Liquid-CfC inference adapter (51-dim, candle ODE)"); } } - Err(e) => warn!("Failed to create Liquid-CfC inference adapter: {}", e), + Err(e) => error!("Failed to create Liquid-CfC inference adapter: {}", e), } // TGGN adapter (51-dim input, 2-layer candle projection) @@ -410,12 +410,12 @@ async fn main() -> Result<()> { .register_loaded_model("TGGN".to_string(), bridge, 0.10) .await { - warn!("Failed to register TGGN adapter: {}", e); + error!("Failed to register TGGN adapter: {}", e); } else { info!("Registered TGGN inference adapter (51-dim, candle projection)"); } } - Err(e) => warn!("Failed to create TGGN inference adapter: {}", e), + Err(e) => error!("Failed to create TGGN inference adapter: {}", e), } // TLOB adapter (51-dim features, 3-layer MLP, seq_len=10) @@ -430,12 +430,12 @@ async fn main() -> Result<()> { .register_loaded_model("TLOB".to_string(), bridge, 0.10) .await { - warn!("Failed to register TLOB adapter: {}", e); + error!("Failed to register TLOB adapter: {}", e); } else { info!("Registered TLOB inference adapter (51-dim, seq=10, candle MLP)"); } } - Err(e) => warn!("Failed to create TLOB inference adapter: {}", e), + Err(e) => error!("Failed to create TLOB inference adapter: {}", e), } // KAN adapter (51-dim input, B-spline activations) @@ -453,12 +453,12 @@ async fn main() -> Result<()> { .register_loaded_model("KAN".to_string(), bridge, 0.10) .await { - warn!("Failed to register KAN adapter: {}", e); + error!("Failed to register KAN adapter: {}", e); } else { info!("Registered KAN inference adapter (51-dim, B-spline, candle)"); } } - Err(e) => warn!("Failed to create KAN inference adapter: {}", e), + Err(e) => error!("Failed to create KAN inference adapter: {}", e), } // xLSTM adapter (51-dim input, sLSTM+mLSTM, seq_len=10) @@ -482,12 +482,12 @@ async fn main() -> Result<()> { .register_loaded_model("xLSTM".to_string(), bridge, 0.10) .await { - warn!("Failed to register xLSTM adapter: {}", e); + error!("Failed to register xLSTM adapter: {}", e); } else { info!("Registered xLSTM inference adapter (51-dim, seq=10, candle)"); } } - Err(e) => warn!("Failed to create xLSTM inference adapter: {}", e), + Err(e) => error!("Failed to create xLSTM inference adapter: {}", e), } // Diffusion adapter (51-dim features, DDPM denoiser, t=1 inference) @@ -511,12 +511,12 @@ async fn main() -> Result<()> { .register_loaded_model("Diffusion".to_string(), bridge, 0.10) .await { - warn!("Failed to register Diffusion adapter: {}", e); + error!("Failed to register Diffusion adapter: {}", e); } else { info!("Registered Diffusion inference adapter (51-dim, DDPM, candle)"); } } - Err(e) => warn!("Failed to create Diffusion inference adapter: {}", e), + Err(e) => error!("Failed to create Diffusion inference adapter: {}", e), } let model_count = coordinator.model_count().await; @@ -650,7 +650,7 @@ async fn main() -> Result<()> { // which closes the channel and signals the prediction loop to stop. prediction_shutdown_handles.push(prediction_shutdown_tx); } else { - warn!("⚠️ Ensemble coordinator not available - prediction generation loop disabled"); + info!("Ensemble coordinator not available - prediction generation loop disabled"); } // Spawn background market data feed for ensemble feature extractor warmup. @@ -734,7 +734,7 @@ async fn main() -> Result<()> { .update_market_data(symbol, new_price, volume, now) .await { - warn!( + debug!( "Market data feed: failed to update {} (tick {}): {}", symbol, tick, e ); @@ -763,7 +763,7 @@ async fn main() -> Result<()> { "Background market data feed spawned for ensemble feature extractor warmup" ); } else { - warn!("Ensemble coordinator not available - market data feed disabled"); + info!("Ensemble coordinator not available - market data feed disabled"); } // Initialize autonomous feedback loop (weight + gate optimization with kill switch) @@ -799,7 +799,7 @@ async fn main() -> Result<()> { info!("Autonomous feedback loop spawned with QuestDB metrics provider"); } None => { - warn!("QuestDB unavailable — feedback loop disabled until QUESTDB_PG_URL is reachable"); + info!("QuestDB unavailable — feedback loop disabled until QUESTDB_PG_URL is reachable"); } } } @@ -837,7 +837,7 @@ async fn main() -> Result<()> { .inc(); } - warn!("ML performance alert handler stopped"); + info!("ML performance alert handler stopped"); }); // Create gRPC services with enhanced ML capabilities @@ -1010,10 +1010,10 @@ async fn main() -> Result<()> { .ok() .and_then(|s| s.parse().ok()) .unwrap_or(DEFAULT_HEALTH_PORT)) => { - warn!("Health endpoint stopped"); + info!("Health endpoint stopped"); } _ = monitor_kill_switch_status(Arc::clone(&kill_switch_system)) => { - warn!("Kill switch monitoring stopped"); + info!("Kill switch monitoring stopped"); } } @@ -1101,7 +1101,7 @@ async fn start_config_monitoring(config_repository: Arc { if status.is_active { - warn!( - "🚨 KILL SWITCH ACTIVE - Trading blocked | Checks: {} | Commands: {} | Error Rate: {:.2}%", + error!( + "KILL SWITCH ACTIVE - Trading blocked | Checks: {} | Commands: {} | Error Rate: {:.2}%", status.total_checks, status.total_commands, status.error_rate * 100.0 diff --git a/services/trading_service/src/questdb_metrics.rs b/services/trading_service/src/questdb_metrics.rs index 4aae8a2e0..1e0dd9e9c 100644 --- a/services/trading_service/src/questdb_metrics.rs +++ b/services/trading_service/src/questdb_metrics.rs @@ -13,7 +13,7 @@ use std::collections::HashMap; use std::sync::Arc; use std::time::Instant; use tokio::sync::RwLock; -use tracing::{debug, warn}; +use tracing::{debug, info}; /// QuestDB metrics provider that queries real time-series data. /// @@ -45,7 +45,7 @@ impl QuestDBMetricsProvider { match Self::new(questdb_pg_url).await { Ok(provider) => Some(provider), Err(e) => { - warn!("QuestDB unavailable at {}: {} — feedback loop will use defaults", questdb_pg_url, e); + info!("QuestDB unavailable at {}: {} — feedback loop will use defaults", questdb_pg_url, e); None } } diff --git a/services/trading_service/src/services/ml.rs b/services/trading_service/src/services/ml.rs index 39a49f64b..eb7dc84c7 100644 --- a/services/trading_service/src/services/ml.rs +++ b/services/trading_service/src/services/ml.rs @@ -120,7 +120,7 @@ impl FeaturePreprocessor { /// Normalize a feature value using z-score normalization pub fn normalize(&self, feature_name: &str, value: f64) -> f64 { if !value.is_finite() { - warn!(feature = %feature_name, value = %value, "NaN/Inf feature detected, replacing with 0.0"); + debug!(feature = %feature_name, value = %value, "NaN/Inf feature detected, replacing with 0.0"); return 0.0; } @@ -1129,7 +1129,7 @@ impl MlService for MLService { daily_performance: vec![], } } else { - warn!( + info!( model_name = %req.model_name, "Model not found in registry — returning empty performance" ); diff --git a/services/trading_service/src/services/ppo_model.rs b/services/trading_service/src/services/ppo_model.rs index f03a02002..11365af79 100644 --- a/services/trading_service/src/services/ppo_model.rs +++ b/services/trading_service/src/services/ppo_model.rs @@ -39,7 +39,7 @@ impl PPOModel { // Try to read architecture config from checkpoint metadata JSON let config = Self::config_from_metadata(actor_path).unwrap_or_else(|e| { - tracing::warn!( + tracing::info!( "PPO '{}': no metadata config ({}) — using hardcoded defaults", model_id, e ); diff --git a/services/trading_service/src/state.rs b/services/trading_service/src/state.rs index 55b66e532..b983cbe4f 100644 --- a/services/trading_service/src/state.rs +++ b/services/trading_service/src/state.rs @@ -258,7 +258,7 @@ impl TradingServiceState { /// Check ensemble coordinator health async fn check_ensemble_health(&self) -> EnsembleHealth { - use tracing::{info, warn}; + use tracing::{error, info}; let ensemble = match &self.ensemble_coordinator { Some(coordinator) => coordinator, @@ -271,7 +271,7 @@ impl TradingServiceState { // Check if models are loaded let model_count = ensemble.model_count().await; if model_count == 0 { - warn!("Ensemble coordinator has no models loaded"); + error!("Ensemble coordinator has no models loaded"); return EnsembleHealth::Unhealthy; } @@ -385,7 +385,7 @@ impl TradingServiceState { let ensemble = match &self.ensemble_coordinator { Some(coordinator) => coordinator, None => { - warn!("Ensemble coordinator not initialized, using fallback strategy"); + info!("Ensemble coordinator not initialized, using fallback strategy"); return self.get_fallback_trading_signal(symbol).await; }, }; @@ -496,8 +496,8 @@ impl TradingServiceState { { Ok(t) => t, Err(e) => { - tracing::warn!( - "FEATURE EXTRACTION: failed to retrieve market ticks for {}: {} — \ + tracing::info!( + "FEATURE EXTRACTION: no market ticks yet for {}: {} — \ using zero-filled features", symbol, e @@ -507,7 +507,7 @@ impl TradingServiceState { }; if ticks.is_empty() { - tracing::warn!( + tracing::info!( "FEATURE EXTRACTION: no market ticks available for {} — \ using zero-filled features", symbol @@ -953,25 +953,25 @@ impl MLEngine { .register_model("DQN".to_string(), dqn_weight) .await { - tracing::warn!("Failed to register DQN model: {}", e); + tracing::error!("Failed to register DQN model: {}", e); } if let Err(e) = coordinator .register_model("PPO".to_string(), ppo_weight) .await { - tracing::warn!("Failed to register PPO model: {}", e); + tracing::error!("Failed to register PPO model: {}", e); } if let Err(e) = coordinator .register_model("TFT".to_string(), tft_weight) .await { - tracing::warn!("Failed to register TFT model: {}", e); + tracing::error!("Failed to register TFT model: {}", e); } if let Err(e) = coordinator .register_model("MAMBA-2".to_string(), mamba2_weight) .await { - tracing::warn!("Failed to register MAMBA-2 model: {}", e); + tracing::error!("Failed to register MAMBA-2 model: {}", e); } let model_count = coordinator.model_count().await; @@ -1058,7 +1058,7 @@ impl MarketDataManager { match data::providers::databento_streaming::DatabentoStreamingProvider::new(api_key) { Ok(mut provider) => { if let Err(e) = provider.connect().await { - tracing::warn!("Failed to connect to Databento: {}", e); + tracing::info!("Databento connection not available: {}", e); } else { tracing::info!("Connected to Databento successfully"); self.databento_provider = Some(Arc::new(RwLock::new(provider))); @@ -1069,7 +1069,7 @@ impl MarketDataManager { }, } } else { - tracing::warn!("DATABENTO_API_KEY not found, skipping Databento provider"); + tracing::info!("DATABENTO_API_KEY not found, skipping Databento provider"); } // Initialize Benzinga provider if API key is available @@ -1107,7 +1107,7 @@ impl MarketDataManager { ) { Ok(mut provider) => { if let Err(e) = provider.connect().await { - tracing::warn!("Failed to connect to Benzinga: {}", e); + tracing::info!("Benzinga connection not available: {}", e); } else { tracing::info!("Connected to Benzinga successfully"); self.benzinga_provider = Some(Arc::new(RwLock::new(provider))); @@ -1118,7 +1118,7 @@ impl MarketDataManager { }, } } else { - tracing::warn!("BENZINGA_API_KEY not found, skipping Benzinga provider"); + tracing::info!("BENZINGA_API_KEY not found, skipping Benzinga provider"); } // Initialize UnifiedFeatureExtractor @@ -1148,7 +1148,7 @@ impl MarketDataManager { ) { Ok(mut provider) => { if let Err(e) = provider.connect().await { - tracing::warn!("Failed to connect to Databento: {}", e); + tracing::info!("Databento connection not available: {}", e); } else { tracing::info!("Connected to Databento successfully via config repository"); self.databento_provider = Some(Arc::new(RwLock::new(provider))); @@ -1159,7 +1159,7 @@ impl MarketDataManager { }, } } else { - tracing::warn!("Databento API key not found in config repository, skipping provider"); + tracing::info!("Databento API key not found in config repository, skipping provider"); } if let Ok(Some(benzinga_key)) = config_repository.get_secret("benzinga_api_key").await { @@ -1195,7 +1195,7 @@ impl MarketDataManager { ) { Ok(mut provider) => { if let Err(e) = provider.connect().await { - tracing::warn!("Failed to connect to Benzinga: {}", e); + tracing::info!("Benzinga connection not available: {}", e); } else { tracing::info!("Connected to Benzinga successfully via config repository"); self.benzinga_provider = Some(Arc::new(RwLock::new(provider))); @@ -1206,7 +1206,7 @@ impl MarketDataManager { }, } } else { - tracing::warn!("Benzinga API key not found in config repository, skipping provider"); + tracing::info!("Benzinga API key not found in config repository, skipping provider"); } // Initialize UnifiedFeatureExtractor with configuration