Crate rustfs_obs

Source
Expand description

§RustFS Observability

provides tools for system and service monitoring

§feature mark

  • file: enable file logging enabled by default
  • gpu: gpu monitoring function
  • kafka: enable kafka metric output
  • webhook: enable webhook notifications
  • full: includes all functions

to enable gpu monitoring add in cargo toml

# using gpu monitoring
rustfs-obs = { version = "0.1.0", features = ["gpu"] }

# use all functions
rustfs-obs = { version = "0.1.0", features = ["full"] }

Structs§

ApiDetails
API details structure ApiDetails is used to define the details of an API operation
AppConfig
Overall application configuration Add observability, sinks, and logger configuration
Args
Args - defines the arguments for API operations Args is used to define the arguments for API operations.
AuditLogEntry
Entry - audit entry logs AuditLogEntry is used to define the structure of an audit log entry
BaseLogEntry
Base log entry structure shared by all log types This structure is used to serialize log entries to JSON and send them to the log sinks This structure is also used to deserialize log entries from JSON This structure is also used to store log entries in the database This structure is also used to query log entries from the database
ConsoleLogEntry
Console log entry structure ConsoleLogEntry is used to log console log entries The ConsoleLogEntry structure contains the following fields:
Logger
Server log processor
LoggerConfig
Logger Configuration
ObjectVersion
ObjectVersion is used across multiple modules
OtelConfig
OpenTelemetry Configuration Add service name, service version, environment Add interval time for metric collection Add sample ratio for trace sampling Add endpoint for metric collection Add use_stdout for output to stdout Add logger level for log level Add local_logging_enabled for local logging enabled
SerializableLevel
Wrapper for tracing_core::Level to implement Serialize and Deserialize for ServerLogEntry This is necessary because tracing_core::Level does not implement Serialize and Deserialize This is a workaround to allow ServerLogEntry to be serialized and deserialized using serde
ServerLogEntry
Server log entry with structured fields ServerLogEntry is used to log structured log entries from the server
SystemObserver

Enums§

GlobalError
Error type for global guard operations
LogKind
Log kind/level enum
SinkConfig
Sink configuration collection
UnifiedLogEntry
Unified log entry type UnifiedLogEntry is used to log different types of log entries

Traits§

LogRecord
Trait for types that can be serialized to JSON and have a timestamp This trait is used by ServerLogEntry to convert the log entry to JSON and get the timestamp of the log entry This trait is implemented by ServerLogEntry

Functions§

get_global_guard
Get the global guard for OpenTelemetry
get_global_logger
Get the global logger instance
get_logger
Get the global logger instance This function returns a reference to the global logger instance.
init_global_logger
Initialize the global logger instance This function initializes the global logger instance and returns a reference to it. If the logger has been initialized before, it will return the existing logger instance.
init_obs
Initialize the observability module
log_debug
Log debug This function logs debug messages.
log_error
Log error This function logs error messages.
log_info
Log information This function logs information messages.
log_trace
Log trace This function logs trace messages.
log_warn
Log warning This function logs warning messages.
log_with_context
Log with context information This function logs messages with context information.
set_global_guard
Set the global guard for OpenTelemetry
start_logger
Start the log module This function starts the log module. It initializes the logger and starts the worker to process logs.
try_get_global_guard
Try to get the global guard for OpenTelemetry