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

View File

@@ -1,11 +1,12 @@
[observability]
endpoint = "http://localhost:4317"
use_stdout = true
endpoint = "http://localhost:4317" # Default is "http://localhost:4317" if not specified
use_stdout = false # Output with stdout, true output, false no output
sample_ratio = 1
meter_interval = 30
service_name = "rustfs_obs"
service_version = "0.1.0"
deployment_environment = "develop"
environments = "develop"
logger_levela = "debug"
[sinks]
[sinks.kafka]
@@ -17,7 +18,8 @@ batch_timeout_ms = 1000 # Default is 1000ms if not specified
[sinks.webhook]
enabled = false
url = "http://localhost:8080/webhook"
endpoint = "http://localhost:8080/webhook"
auth_token = ""
batch_size = 100 # Default is 3 if not specified
batch_timeout_ms = 1000 # Default is 100ms if not specified

View File

@@ -258,7 +258,7 @@ pub fn init_telemetry(config: &OtelConfig) -> OtelGuard {
}
_ => {
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

View File

@@ -24,6 +24,8 @@ set RUSTFS_ADDRESS=0.0.0.0:9000
set RUSTFS_CONSOLE_ENABLE=true
set RUSTFS_CONSOLE_ADDRESS=0.0.0.0:9002
rem set RUSTFS_SERVER_DOMAINS=localhost:9000
rem 具体路径修改为配置文件真实路径obs.example.toml 仅供参考
set RUSTFS_OBS_CONFIG=.\config\obs.example.toml"
if not "%~1"=="" (
set RUSTFS_VOLUMES=%~1