From 631d93092eca5581d04700cc7aab01125e6590fb Mon Sep 17 00:00:00 2001 From: Zhengchao An Date: Sun, 12 Jul 2026 11:10:42 +0800 Subject: [PATCH] docs(obs): align OtelConfig doc defaults with actual constants (#4760) Six doc-comments on `OtelConfig` fields stated defaults that disagreed with the constants the runtime actually applies in `extract_otel_config_from_env`. Correct them to match: - profiling_export_enabled: false -> true (DEFAULT_OBS_PROFILING_EXPORT_ENABLED) - sample_ratio: 0.1 -> 1.0 (SAMPLE_RATIO) - meter_interval: 15 -> 30 (METER_INTERVAL) - logger_level: info -> error (DEFAULT_LOG_LEVEL) - log_rotation_time: daily -> hourly (DEFAULT_LOG_ROTATION_TIME), and document the full minutely/hourly/daily set plus the daily fallback - log_cleanup_interval_seconds: 21600 -> 1800 (DEFAULT_OBS_LOG_CLEANUP_INTERVAL_SECONDS) Doc-comment only; no behavior change. --- crates/obs/src/config.rs | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/crates/obs/src/config.rs b/crates/obs/src/config.rs index 108eb3c03..f43f4fe3d 100644 --- a/crates/obs/src/config.rs +++ b/crates/obs/src/config.rs @@ -148,14 +148,14 @@ pub struct OtelConfig { pub metrics_export_enabled: Option, /// Whether to export logs via OTLP (default: `true`). pub logs_export_enabled: Option, - /// Whether to export profiles via pyroscope (default: `false`). + /// Whether to export profiles via pyroscope (default: `true`). pub profiling_export_enabled: Option, /// **[OTLP-only]** Mirror all signals to stdout in addition to OTLP export. /// Only applies when an OTLP endpoint is configured. pub use_stdout: Option, - /// Fraction of traces to sample, `0.0`–`1.0` (default: `0.1`). + /// Fraction of traces to sample, `0.0`–`1.0` (default: `1.0`). pub sample_ratio: Option, - /// Metrics export interval in seconds (default: `15`). + /// Metrics export interval in seconds (default: `30`). pub meter_interval: Option, /// OTel `service.name` attribute (default: `APP_NAME`). pub service_name: Option, @@ -165,7 +165,7 @@ pub struct OtelConfig { pub environment: Option, // ── Local logging ───────────────────────────────────────────────────────── - /// Minimum log level directive (default: `info`). + /// Minimum log level directive (default: `error`). /// Respects `RUST_LOG` syntax when set via environment. pub logger_level: Option, /// When `true`, a stdout JSON layer is always attached regardless of the @@ -177,7 +177,8 @@ pub struct OtelConfig { /// Base name for log files (without date suffix), e.g. `rustfs`. /// Used for both rolling-appender naming and cleanup scanning. pub log_filename: Option, - /// Rotation time granularity: `"hourly"` or `"daily"` (default: `"daily"`). + /// Rotation time granularity: `"minutely"`, `"hourly"`, or `"daily"` + /// (default: `"hourly"`; any unrecognized value falls back to `"daily"`). pub log_rotation_time: Option, /// Number of rolling log files to retain (default: `30`). /// Used by both the rolling-appender (as a loose upper bound) and the @@ -214,7 +215,7 @@ pub struct OtelConfig { pub log_delete_empty_files: Option, /// A file younger than this many seconds is never touched (default: `3600`). pub log_min_file_age_seconds: Option, - /// How often the background cleanup task runs, in seconds (default: `21600`). + /// How often the background cleanup task runs, in seconds (default: `1800`). pub log_cleanup_interval_seconds: Option, /// Log what *would* be deleted without actually removing anything /// (default: `false`).