Skip to main content

Crate rustfs_obs

Crate rustfs_obs 

Source
Expand description

§RustFS Observability

provides tools for system and service monitoring

§Features

This crate provides observability tools for RustFS:

  • Logging with tracing
  • Metrics collection
  • Distributed tracing
  • Tokio runtime telemetry (via dial9)

§Usage

use rustfs_obs::init_obs;

§Metrics Runtime

Start metrics scheduling with rustfs_obs::init_metrics_runtime().

ⓘ
use tokio_util::sync::CancellationToken;
use rustfs_obs::init_metrics_runtime;

let token = CancellationToken::new();
init_metrics_runtime(token.clone());

Re-exports§

pub use metrics::MetricsRuntimeCancellationSource;
pub use metrics::MetricsRuntimeController;
pub use metrics::MetricsRuntimeControllerSnapshot;
pub use metrics::MetricsRuntimeDesiredSnapshot;
pub use metrics::MetricsRuntimeDesiredState;
pub use metrics::MetricsRuntimeIntervalsSnapshot;
pub use metrics::MetricsRuntimeReconcilePlan;
pub use metrics::MetricsRuntimeServiceState;
pub use metrics::MetricsRuntimeShutdownHandle;
pub use metrics::MetricsRuntimeStatusSnapshot;
pub use metrics::MetricsRuntimeWorkerMutation;
pub use metrics::init_metrics_runtime;
pub use metrics::metrics_runtime_controller_snapshot;
pub use metrics::metrics_runtime_status_snapshot;
pub use metrics::schema::*;

Modules§

dial9
Tokio runtime-level telemetry via dial9.
metrics
types
Shared types used across the log-cleanup sub-modules.

Structs§

AppConfig
Top-level application configuration that embeds OtelConfig.
LogCleaner
Primary entry point for the cleaner subsystem.
MaskedAccessKey
OtelConfig
Full observability configuration used by all telemetry backends.
OtelGuard
RAII guard that owns all active OpenTelemetry providers and the tracing_appender worker guard.
Recorder
A standard recorder that implements metrics::Recorder.

Enums§

GlobalError
Error type for global guard operations
TelemetryError

Constants§

HTTP_SERVER_LOG_TARGET
LOGGING_REDACTION_RULES
REDACTED_LOG_VALUE

Functions§

get_global_guard
Get the global guard for OtelGuard
init_obs
Initialize the observability module
init_obs_with_config
Initialize the observability module with an explicit OtelConfig.
is_production_environment
Returns true when the current runtime environment is production.
is_sensitive_log_field
observability_metric_enabled
Check whether Observability metric is enabled
redacted_log_value
redacted_optional_log_value
set_global_guard
Set the global guard for OtelGuard
shutdown_global_guard
Explicitly drop the global guard so telemetry providers can flush before exit.
validate_logging_redaction_rules