improve code for observability

This commit is contained in:
houseme
2025-04-02 18:23:20 +08:00
parent 0b552b1697
commit 3a0ea8992f
3 changed files with 9 additions and 5 deletions
+6 -4
View File
@@ -1,11 +1,12 @@
[observability] [observability]
endpoint = "http://localhost:4317" endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified
use_stdout = true use_stdout = false # Output with stdout, true output, false no output
sample_ratio = 1 sample_ratio = 1
meter_interval = 30 meter_interval = 30
service_name = "rustfs_obs" service_name = "rustfs_obs"
service_version = "0.1.0" service_version = "0.1.0"
deployment_environment = "develop" environments = "develop"
logger_levela = "debug"
[sinks] [sinks]
[sinks.kafka] [sinks.kafka]
@@ -17,7 +18,8 @@ batch_timeout_ms = 1000 # Default is 1000ms if not specified
[sinks.webhook] [sinks.webhook]
enabled = false enabled = false
url = "http://localhost:8080/webhook" endpoint = "http://localhost:8080/webhook"
auth_token = ""
batch_size = 100 # Default is 3 if not specified batch_size = 100 # Default is 3 if not specified
batch_timeout_ms = 1000 # Default is 100ms if not specified batch_timeout_ms = 1000 # Default is 100ms if not specified
+1 -1
View File
@@ -258,7 +258,7 @@ pub fn init_telemetry(config: &OtelConfig) -> OtelGuard {
} }
_ => { _ => {
let mut filter = EnvFilter::new(logger_level); let mut filter = EnvFilter::new(logger_level);
for directive in ["hyper", "opentelemetry", "tonic", "h2", "reqwest"] { for directive in ["hyper", "tonic", "h2", "reqwest"] {
filter = filter.add_directive(format!("{}=off", directive).parse().unwrap()); filter = filter.add_directive(format!("{}=off", directive).parse().unwrap());
} }
filter filter
+2
View File
@@ -24,6 +24,8 @@ set RUSTFS_ADDRESS=0.0.0.0:9000
set RUSTFS_CONSOLE_ENABLE=true set RUSTFS_CONSOLE_ENABLE=true
set RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002 set RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
rem set RUSTFS_SERVER_DOMAINS=localhost:9000 rem set RUSTFS_SERVER_DOMAINS=localhost:9000
rem 具体路径修改为配置文件真实路径,obs.example.toml 仅供参考
set RUSTFS_OBS_CONFIG=.\config\obs.example.toml"
if not "%~1"=="" ( if not "%~1"=="" (
set RUSTFS_VOLUMES=%~1 set RUSTFS_VOLUMES=%~1