rename rustfs-logging to rustfs-obs

This commit is contained in:
houseme
2025-03-09 10:47:03 +08:00
parent 4ecb53c526
commit bcab86fc38
8 changed files with 181 additions and 32 deletions

172
Cargo.lock generated
View File

@@ -1377,7 +1377,7 @@ dependencies = [
"futures-util",
"generational-box",
"longest-increasing-subsequence",
"rustc-hash",
"rustc-hash 1.1.0",
"rustversion",
"serde",
"slab",
@@ -1443,7 +1443,7 @@ dependencies = [
"objc_id",
"once_cell",
"rfd 0.14.1",
"rustc-hash",
"rustc-hash 1.1.0",
"serde",
"serde_json",
"signal-hook",
@@ -1604,7 +1604,7 @@ dependencies = [
"dioxus-html",
"js-sys",
"lazy-js-bundle",
"rustc-hash",
"rustc-hash 1.1.0",
"serde",
"sledgehammer_bindgen",
"sledgehammer_utils",
@@ -1710,7 +1710,7 @@ dependencies = [
"generational-box",
"once_cell",
"parking_lot 0.12.3",
"rustc-hash",
"rustc-hash 1.1.0",
"tracing",
"warnings",
]
@@ -1737,7 +1737,7 @@ dependencies = [
"generational-box",
"js-sys",
"lazy-js-bundle",
"rustc-hash",
"rustc-hash 1.1.0",
"serde",
"serde-wasm-bindgen",
"serde_json",
@@ -1971,6 +1971,15 @@ version = "1.14.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b7914353092ddf589ad78f25c5c1c21b7f80b0ff8621e7c814c3485b5306da9d"
[[package]]
name = "encoding_rs"
version = "0.8.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "75030f3c4f45dafd7586dd6780965a8c7e8e285a5ecb86713e63a79c5b2766f3"
dependencies = [
"cfg-if",
]
[[package]]
name = "endi"
version = "1.1.0"
@@ -2881,6 +2890,24 @@ dependencies = [
"want",
]
[[package]]
name = "hyper-rustls"
version = "0.27.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2"
dependencies = [
"futures-util",
"http",
"hyper",
"hyper-util",
"rustls",
"rustls-pki-types",
"tokio",
"tokio-rustls",
"tower-service",
"webpki-roots",
]
[[package]]
name = "hyper-timeout"
version = "0.5.2"
@@ -4912,6 +4939,58 @@ dependencies = [
"serde",
]
[[package]]
name = "quinn"
version = "0.11.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "62e96808277ec6f97351a2380e6c25114bc9e67037775464979f3037c92d05ef"
dependencies = [
"bytes",
"pin-project-lite",
"quinn-proto",
"quinn-udp",
"rustc-hash 2.1.1",
"rustls",
"socket2",
"thiserror 2.0.11",
"tokio",
"tracing",
]
[[package]]
name = "quinn-proto"
version = "0.11.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a2fe5ef3495d7d2e377ff17b1a8ce2ee2ec2a18cde8b6ad6619d65d0701c135d"
dependencies = [
"bytes",
"getrandom 0.2.15",
"rand 0.8.5",
"ring",
"rustc-hash 2.1.1",
"rustls",
"rustls-pki-types",
"slab",
"thiserror 2.0.11",
"tinyvec",
"tracing",
"web-time",
]
[[package]]
name = "quinn-udp"
version = "0.5.10"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e46f3055866785f6b92bc6164b76be02ca8f2eb4b002c0354b28cf4c119e5944"
dependencies = [
"cfg_aliases",
"libc",
"once_cell",
"socket2",
"tracing",
"windows-sys 0.52.0",
]
[[package]]
name = "quote"
version = "1.0.38"
@@ -5197,19 +5276,16 @@ checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da"
dependencies = [
"base64",
"bytes",
<<<<<<< HEAD
"encoding_rs",
"futures-channel",
||||||| e65bee0
"encoding_rs",
=======
>>>>>>> 1d58a07f296b9dedba832bb31b31eb9faf38b85c
"futures-core",
"futures-util",
"h2",
"http",
"http-body",
"http-body-util",
"hyper",
"hyper-rustls",
"hyper-util",
"ipnet",
"js-sys",
@@ -5219,11 +5295,17 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
"quinn",
"rustls",
"rustls-pemfile",
"rustls-pki-types",
"serde",
"serde_json",
"serde_urlencoded",
"sync_wrapper",
"system-configuration",
"tokio",
"tokio-rustls",
"tokio-util",
"tower 0.5.2",
"tower-service",
@@ -5232,6 +5314,7 @@ dependencies = [
"wasm-bindgen-futures",
"wasm-streams",
"web-sys",
"webpki-roots",
"windows-registry",
]
@@ -5365,6 +5448,12 @@ version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2"
[[package]]
name = "rustc-hash"
version = "2.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
[[package]]
name = "rustc_version"
version = "0.4.1"
@@ -5416,6 +5505,7 @@ dependencies = [
"protos",
"rmp-serde",
"rust-embed",
"rustfs-obs",
"s3s",
"serde",
"serde_json",
@@ -5460,7 +5550,7 @@ dependencies = [
]
[[package]]
name = "rustfs-logging"
name = "rustfs-obs"
version = "0.0.1"
dependencies = [
"chrono",
@@ -5522,6 +5612,9 @@ name = "rustls-pki-types"
version = "1.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "917ce264624a4b4db1c364dcc35bfca9ded014d0a958cd47ad3e960e988ea51c"
dependencies = [
"web-time",
]
[[package]]
name = "rustls-webpki"
@@ -6024,7 +6117,7 @@ version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "debdd4b83524961983cea3c55383b3910fd2f24fd13a188f5b091d2d504a61ae"
dependencies = [
"rustc-hash",
"rustc-hash 1.1.0",
]
[[package]]
@@ -6208,6 +6301,27 @@ dependencies = [
"syn 2.0.98",
]
[[package]]
name = "system-configuration"
version = "0.6.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b"
dependencies = [
"bitflags 2.9.0",
"core-foundation 0.9.4",
"system-configuration-sys",
]
[[package]]
name = "system-configuration-sys"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4"
dependencies = [
"core-foundation-sys",
"libc",
]
[[package]]
name = "system-deps"
version = "6.2.2"
@@ -6435,6 +6549,21 @@ dependencies = [
"zerovec",
]
[[package]]
name = "tinyvec"
version = "1.9.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71"
dependencies = [
"tinyvec_macros",
]
[[package]]
name = "tinyvec_macros"
version = "0.1.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.43.0"
@@ -7227,6 +7356,16 @@ dependencies = [
"wasm-bindgen",
]
[[package]]
name = "web-time"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb"
dependencies = [
"js-sys",
"wasm-bindgen",
]
[[package]]
name = "webbrowser"
version = "0.8.15"
@@ -7288,6 +7427,15 @@ dependencies = [
"system-deps",
]
[[package]]
name = "webpki-roots"
version = "0.26.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2210b291f7ea53617fbafcc4939f10914214ec15aace5ba62293a668f322c5c9"
dependencies = [
"rustls-pki-types",
]
[[package]]
name = "webview2-com"
version = "0.33.0"

View File

@@ -13,7 +13,7 @@ members = [
"iam", # Identity and Access Management
"crypto", # Cryptography and security features
"cli/rustfs-gui", # Graphical user interface client
"packages/logging", # Logging utilities
"packages/obs", # Observability utilities
]
resolver = "2"
@@ -81,7 +81,7 @@ rdkafka = { version = "0.37", features = ["tokio"] }
rfd = { version = "0.15.2", default-features = false, features = ["xdg-portal", "tokio"] }
rmp = "0.8.14"
rmp-serde = "1.3.0"
rustfs-logging = { path = "packages/logging", version = "0.0.1" }
rustfs-obs = { path = "packages/obs", version = "0.0.1" }
rust-embed = "8.6.0"
s3s = { git = "https://github.com/Nugine/s3s.git", rev = "ab139f72fe768fb9d8cecfe36269451da1ca9779", default-features = true, features = [
"tower",

View File

@@ -1,5 +1,5 @@
[package]
name = "rustfs-logging"
name = "rustfs-obs"
edition.workspace = true
license.workspace = true
repository.workspace = true

View File

@@ -23,7 +23,7 @@ use tokio::sync::mpsc;
/// * `span_id` - The span ID of the event
/// # Example
/// ```
/// use rustfs_logging::AuditEntry;
/// use rustfs_obs::AuditEntry;
/// let entry = AuditEntry {
/// version: "1.0".to_string(),
/// event_type: "read".to_string(),
@@ -63,7 +63,7 @@ impl AuditTarget for FileAuditTarget {
///
/// # Example
/// ```
/// use rustfs_logging::{AuditEntry, AuditTarget, FileAuditTarget};
/// use rustfs_obs::{AuditEntry, AuditTarget, FileAuditTarget};
/// let entry = AuditEntry {
/// version: "1.0".to_string(),
/// event_type: "read".to_string(),
@@ -88,7 +88,7 @@ impl AuditTarget for FileAuditTarget {
/// * `url` - The URL of the webhook
/// # Example
/// ```
/// use rustfs_logging::WebhookAuditTarget;
/// use rustfs_obs::WebhookAuditTarget;
/// let target = WebhookAuditTarget::new("http://localhost:8080");
/// ```
pub struct WebhookAuditTarget {
@@ -126,7 +126,7 @@ impl AuditTarget for WebhookAuditTarget {
/// * `topic` - The Kafka topic
/// # Example
/// ```
/// use rustfs_logging::KafkaAuditTarget;
/// use rustfs_obs::KafkaAuditTarget;
/// let target = KafkaAuditTarget::new("localhost:9092", "rustfs-audit");
/// ```
/// # Note
@@ -135,7 +135,7 @@ impl AuditTarget for WebhookAuditTarget {
/// ```toml
/// [dependencies]
/// rdkafka = "0.26.0"
/// rustfs_logging = { version = "0.1.0", features = ["audit-kafka"] }
/// rustfs_obs = { version = "0.1.0", features = ["audit-kafka"] }
/// ```
/// # Note
/// The `rdkafka` crate requires the `librdkafka` library to be installed
@@ -214,7 +214,7 @@ impl AuditTarget for KafkaAuditTarget {
///
/// # Example
/// ```
/// use rustfs_logging::{AuditEntry, AuditLogger, FileAuditTarget};
/// use rustfs_obs::{AuditEntry, AuditLogger, FileAuditTarget};
///
/// #[tokio::main]
/// async fn main() {
@@ -238,7 +238,7 @@ impl AuditTarget for KafkaAuditTarget {
/// to multiple targets
/// # Example
/// ```
/// use rustfs_logging::{AuditEntry, AuditLogger, FileAuditTarget};
/// use rustfs_obs::{AuditEntry, AuditLogger, FileAuditTarget};
/// let logger = AuditLogger::new(vec![Box::new(FileAuditTarget)]);
/// ```
/// # Note
@@ -247,7 +247,7 @@ impl AuditTarget for KafkaAuditTarget {
/// ```toml
/// [dependencies]
/// tokio = { version = "1", features = ["full"] }
/// rustfs_logging = { version = "0.1.0"}
/// rustfs_obs = { version = "0.1.0"}
/// ```
/// # Note
/// This feature requires the `serde` crate
@@ -255,7 +255,7 @@ impl AuditTarget for KafkaAuditTarget {
/// ```toml
/// [dependencies]
/// serde = { version = "1", features = ["derive"] }
/// rustfs_logging = { version = "0.1.0"}
/// rustfs_obs = { version = "0.1.0"}
/// ```
pub struct AuditLogger {
tx: mpsc::Sender<AuditEntry>,
@@ -270,7 +270,7 @@ impl AuditLogger {
/// * An AuditLogger
/// # Example
/// ```
/// use rustfs_logging::{AuditLogger, AuditEntry, FileAuditTarget};
/// use rustfs_obs::{AuditLogger, AuditEntry, FileAuditTarget};
///
/// let logger = AuditLogger::new(vec![Box::new(FileAuditTarget)]);
/// ```
@@ -291,7 +291,7 @@ impl AuditLogger {
/// * `entry` - The audit entry to log
/// # Example
/// ```
/// use rustfs_logging::{AuditEntry, AuditLogger, FileAuditTarget};
/// use rustfs_obs::{AuditEntry, AuditLogger, FileAuditTarget};
///
/// #[tokio::main]
/// async fn main() {

View File

@@ -5,7 +5,7 @@
///
/// # Examples
/// ```
/// use rustfs_logging::{log_info, log_error};
/// use rustfs_obs::{log_info, log_error};
///
/// log_info("This is an informational message");
/// log_error("This is an error message");
@@ -24,7 +24,7 @@ mod telemetry;
#[cfg(test)]
mod tests {
use super::*;
use crate::{log_info, AuditEntry, AuditLogger, AuditTarget, FileAuditTarget, Telemetry};
use chrono::Utc;
use opentelemetry::global;
use opentelemetry::trace::{TraceContextExt, Tracer};

View File

@@ -7,7 +7,7 @@ use tracing::{debug, error, info};
///
/// # Example
/// ```
/// use rustfs_logging::log_info;
/// use rustfs_obs::log_info;
///
/// log_info("This is an info message");
/// ```
@@ -22,7 +22,7 @@ pub fn log_info(msg: &str) {
///
/// # Example
/// ```
/// use rustfs_logging::log_error;
/// use rustfs_obs::log_error;
///
/// log_error("This is an error message");
/// ```
@@ -37,7 +37,7 @@ pub fn log_error(msg: &str) {
///
/// # Example
/// ```
/// use rustfs_logging::log_debug;
/// use rustfs_obs::log_debug;
///
/// log_debug("This is a debug message");
/// ```

View File

@@ -25,7 +25,7 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt, EnvFilte
///
/// # Example
/// ```
/// use rustfs_logging::Telemetry;
/// use rustfs_obs::Telemetry;
///
/// let _telemetry = Telemetry::init();
/// ```

View File

@@ -76,6 +76,7 @@ mime_guess = "2.0.5"
rust-embed = { workspace = true, features = ["interpolate-folder-path"] }
local-ip-address = { workspace = true }
chrono = { workspace = true }
rustfs-obs = { workspace = true }
[build-dependencies]
prost-build.workspace = true