Expand description
§RustFS Observability
provides tools for system and service monitoring
§feature mark
file
: enable file logging enabled by defaultgpu
: gpu monitoring functionkafka
: enable kafka metric outputwebhook
: enable webhook notificationsfull
: 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.
- Audit
LogEntry - Entry - audit entry logs AuditLogEntry is used to define the structure of an audit log entry
- Base
LogEntry - 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
- Console
LogEntry - Console log entry structure
ConsoleLogEntry is used to log console log entries
The
ConsoleLogEntry
structure contains the following fields: - Logger
- Server log processor
- Logger
Config - Logger Configuration
- Object
Version - ObjectVersion is used across multiple modules
- Otel
Config - 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
- Serializable
Level - Wrapper for
tracing_core::Level
to implementSerialize
andDeserialize
forServerLogEntry
This is necessary becausetracing_core::Level
does not implementSerialize
andDeserialize
This is a workaround to allowServerLogEntry
to be serialized and deserialized usingserde
- Server
LogEntry - Server log entry with structured fields ServerLogEntry is used to log structured log entries from the server
- System
Observer
Enums§
- Global
Error - Error type for global guard operations
- LogKind
- Log kind/level enum
- Sink
Config - Sink configuration collection
- Unified
LogEntry - 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 byServerLogEntry
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