fix(obs): tighten low-risk telemetry correctness (#4483)

Refs rustfs/backlog#1007
Refs rustfs/backlog#986

- respect explicit log-target directives when injecting noisy-crate suppressions
- fix daily rotation day-boundary checks and add a short retry cooldown after failed rotations
- preserve recorder metadata across label variants and serialize gauge updates before export
- correct profiling target_env reporting, trace all=true parsing, cleaner accounting/docs, and legacy system interval rounding

Co-authored-by: heihutu <heihutu@gmail.com>
This commit is contained in:
houseme
2026-07-08 22:06:19 +08:00
committed by GitHub
parent dee8e4e639
commit 87044b2378
12 changed files with 217 additions and 31 deletions
+26 -7
View File
@@ -93,13 +93,6 @@ impl ServiceTraceOpts {
self.batch_replication = query_pairs.get("batch-replication").is_some_and(|v| v == "true");
self.batch_key_rotation = query_pairs.get("batch-keyrotation").is_some_and(|v| v == "true");
self.batch_expire = query_pairs.get("batch-expire").is_some_and(|v| v == "true");
if query_pairs.get("all").is_some_and(|v| v == "true") {
self.s3 = true;
self.internal = true;
self.storage = true;
self.os = true;
}
self.rebalance = query_pairs.get("rebalance").is_some_and(|v| v == "true");
self.storage = query_pairs.get("storage").is_some_and(|v| v == "true");
self.internal = query_pairs.get("internal").is_some_and(|v| v == "true");
@@ -109,6 +102,13 @@ impl ServiceTraceOpts {
self.ftp = query_pairs.get("ftp").is_some_and(|v| v == "true");
self.ilm = query_pairs.get("ilm").is_some_and(|v| v == "true");
if query_pairs.get("all").is_some_and(|v| v == "true") {
self.s3 = true;
self.internal = true;
self.storage = true;
self.os = true;
}
if let Some(threshold) = query_pairs.get("threshold") {
let duration = parse_duration(threshold)?;
self.threshold = duration;
@@ -117,3 +117,22 @@ impl ServiceTraceOpts {
Ok(())
}
}
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn parse_params_all_true_keeps_internal_and_storage_enabled() {
let uri: Uri = "/trace?all=true".parse().expect("valid uri");
let mut opts = ServiceTraceOpts::default();
opts.parse_params(&uri).expect("all=true should parse");
let trace_types = opts.trace_types();
assert!(trace_types.contains(&TraceType::S3));
assert!(trace_types.contains(&TraceType::INTERNAL));
assert!(trace_types.contains(&TraceType::STORAGE));
assert!(trace_types.contains(&TraceType::OS));
}
}