mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-08 14:23:13 +00:00
refactor(obs): migrate metrics runtime/schema and tighten migration guards (#2584)
This commit is contained in:
+3
-5
@@ -43,16 +43,15 @@ bench = false
|
||||
required-features = ["manual-test-runners"]
|
||||
|
||||
[features]
|
||||
default = ["direct-io"]
|
||||
metrics-gpu = ["rustfs-metrics/gpu"]
|
||||
default = []
|
||||
metrics-gpu = ["rustfs-obs/gpu"]
|
||||
ftps = ["rustfs-protocols/ftps"]
|
||||
swift = ["rustfs-protocols/swift"]
|
||||
webdav = ["rustfs-protocols/webdav"]
|
||||
license = []
|
||||
direct-io = [] # Aligned direct I/O reader support (uses aligned pread, does not set O_DIRECT)
|
||||
io-scheduler-debug = [] # Enable debug information in I/O scheduler
|
||||
tracing-chunk-debug = [] # Enable per-chunk tracing in data plane (high noise, for debugging only)
|
||||
full = ["metrics-gpu", "ftps", "swift", "webdav", "direct-io"]
|
||||
full = ["metrics-gpu", "ftps", "swift", "webdav"]
|
||||
manual-test-runners = []
|
||||
|
||||
[lints]
|
||||
@@ -74,7 +73,6 @@ rustfs-keystone = { workspace = true }
|
||||
rustfs-kms = { workspace = true }
|
||||
rustfs-lock.workspace = true
|
||||
rustfs-madmin = { workspace = true }
|
||||
rustfs-metrics = { workspace = true }
|
||||
rustfs-notify = { workspace = true }
|
||||
rustfs-obs = { workspace = true }
|
||||
rustfs-policy = { workspace = true }
|
||||
|
||||
@@ -590,20 +590,13 @@ struct FeatureSpec {
|
||||
default_enabled: bool,
|
||||
}
|
||||
|
||||
fn feature_specs() -> [FeatureSpec; 9] {
|
||||
fn feature_specs() -> [FeatureSpec; 8] {
|
||||
[
|
||||
FeatureSpec {
|
||||
name: "direct-io",
|
||||
enabled: cfg!(feature = "direct-io"),
|
||||
description: "Aligned pread-based direct I/O reader support",
|
||||
dependencies: "(none)",
|
||||
default_enabled: true,
|
||||
},
|
||||
FeatureSpec {
|
||||
name: "metrics-gpu",
|
||||
enabled: cfg!(feature = "metrics-gpu"),
|
||||
description: "Metrics GPU support",
|
||||
dependencies: "rustfs-metrics/gpu",
|
||||
dependencies: "rustfs-obs/gpu",
|
||||
default_enabled: false,
|
||||
},
|
||||
FeatureSpec {
|
||||
@@ -652,7 +645,7 @@ fn feature_specs() -> [FeatureSpec; 9] {
|
||||
name: "full",
|
||||
enabled: cfg!(feature = "full"),
|
||||
description: "All features enabled",
|
||||
dependencies: "metrics-gpu + ftps + swift + webdav + direct-io",
|
||||
dependencies: "metrics-gpu + ftps + swift + webdav",
|
||||
default_enabled: false,
|
||||
},
|
||||
]
|
||||
@@ -926,13 +919,13 @@ mod tests {
|
||||
let info = collect_deps_info_json();
|
||||
let feature_names: Vec<_> = info.features.iter().map(|feature| feature.name).collect();
|
||||
|
||||
assert_eq!(info.total_count, 9);
|
||||
assert_eq!(info.features.len(), 9);
|
||||
assert!(feature_names.contains(&"direct-io"));
|
||||
assert_eq!(info.total_count, 8);
|
||||
assert_eq!(info.features.len(), 8);
|
||||
assert!(feature_names.contains(&"metrics-gpu"));
|
||||
assert!(feature_names.contains(&"io-scheduler-debug"));
|
||||
assert!(feature_names.contains(&"manual-test-runners"));
|
||||
assert!(!feature_names.contains(&"metrics"));
|
||||
assert!(!feature_names.contains(&"direct-io"));
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -942,7 +935,7 @@ mod tests {
|
||||
assert!(output.contains("| metrics-gpu |"));
|
||||
assert!(output.contains("| io-scheduler-debug |"));
|
||||
assert!(output.contains("| manual-test-runners |"));
|
||||
assert!(output.contains("| direct-io | enabled by default |"));
|
||||
assert!(output.contains("| full | metrics-gpu + ftps + swift + webdav + direct-io |"));
|
||||
assert!(output.contains("| full | metrics-gpu + ftps + swift + webdav |"));
|
||||
assert!(!output.contains("| direct-io |"));
|
||||
}
|
||||
}
|
||||
|
||||
+2
-3
@@ -53,8 +53,7 @@ use rustfs_heal::{
|
||||
create_ahm_services_cancel_token, heal::storage::ECStoreHealStorage, init_heal_manager, shutdown_ahm_services,
|
||||
};
|
||||
use rustfs_iam::{init_iam_sys, init_oidc_sys};
|
||||
use rustfs_metrics::init_metrics_system;
|
||||
use rustfs_obs::{init_obs, set_global_guard};
|
||||
use rustfs_obs::{init_metrics_runtime, init_obs, set_global_guard};
|
||||
use rustfs_scanner::init_data_scanner;
|
||||
use rustfs_utils::{
|
||||
ExternalEnvCompatReport, apply_external_env_compat, get_env_bool_with_aliases, net::parse_and_resolve_address,
|
||||
@@ -563,7 +562,7 @@ async fn run(config: rustfs::config::Config) -> Result<()> {
|
||||
|
||||
if rustfs_obs::observability_metric_enabled() {
|
||||
// Initialize metrics system
|
||||
init_metrics_system(ctx.clone());
|
||||
init_metrics_runtime(ctx.clone());
|
||||
|
||||
// Initialize auto-tuner for performance optimization (optional)
|
||||
rustfs::init::init_auto_tuner(ctx.clone()).await;
|
||||
|
||||
Reference in New Issue
Block a user