feat(obs): enhance OpenTelemetry configuration and logging

Improve observability setup with the following changes:

- Replace static OnceCell with tokio::sync::OnceCell for guard management
- Add logger_level to OtelConfig for configurable tracing verbosity
- Improve telemetry initialization with better error handling
- Enhance logging filters and span configuration

Breaking Changes:
- Configuration now requires logger_level field
- Global guard management uses async-safe primitives

Example config:
observability:
  endpoint: "http://localhost:4317"
  logger_level: "debug"  # New required field
This commit is contained in:
houseme
2025-03-27 18:03:47 +08:00
parent 6f706c102e
commit c4c6d439bc
7 changed files with 281 additions and 98 deletions
+2 -1
View File
@@ -5,7 +5,8 @@ sample_ratio = 0.5
meter_interval = 30
service_name = "rustfs"
service_version = "0.1.0"
deployment_environment = "develop"
environment = "develop"
looger_level = "info"
[sinks]
[sinks.kafka] # Kafka sink is disabled by default