mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-13 00:26:53 +00:00
chore(deps): bump the dependencies group with 6 updates (#3151)
* chore(deps): bump the dependencies group with 6 updates Bumps the dependencies group with 6 updates: | Package | From | To | | --- | --- | --- | | [hyper](https://github.com/hyperium/hyper) | `1.10.0` | `1.10.1` | | [serial_test](https://github.com/palfrey/serial_test) | `3.4.0` | `3.5.0` | | [snafu](https://github.com/shepmaster/snafu) | `0.9.0` | `0.9.1` | | [uuid](https://github.com/uuid-rs/uuid) | `1.23.1` | `1.23.2` | | [dial9-tokio-telemetry](https://github.com/dial9-rs/dial9-tokio-telemetry) | `0.3.12` | `0.3.13` | | [pyroscope](https://github.com/grafana/pyroscope-rs) | `2.0.5` | `2.0.6` | Updates `hyper` from 1.10.0 to 1.10.1 - [Release notes](https://github.com/hyperium/hyper/releases) - [Changelog](https://github.com/hyperium/hyper/blob/master/CHANGELOG.md) - [Commits](https://github.com/hyperium/hyper/compare/v1.10.0...v1.10.1) Updates `serial_test` from 3.4.0 to 3.5.0 - [Release notes](https://github.com/palfrey/serial_test/releases) - [Commits](https://github.com/palfrey/serial_test/compare/v3.4.0...v3.5.0) Updates `snafu` from 0.9.0 to 0.9.1 - [Changelog](https://github.com/shepmaster/snafu/blob/main/CHANGELOG.md) - [Commits](https://github.com/shepmaster/snafu/compare/0.9.0...0.9.1) Updates `uuid` from 1.23.1 to 1.23.2 - [Release notes](https://github.com/uuid-rs/uuid/releases) - [Commits](https://github.com/uuid-rs/uuid/compare/v1.23.1...v1.23.2) Updates `dial9-tokio-telemetry` from 0.3.12 to 0.3.13 - [Release notes](https://github.com/dial9-rs/dial9-tokio-telemetry/releases) - [Changelog](https://github.com/dial9-rs/dial9/blob/main/CHANGELOG.md) - [Commits](https://github.com/dial9-rs/dial9-tokio-telemetry/compare/dial9-tokio-telemetry-v0.3.12...dial9-tokio-telemetry-v0.3.13) Updates `pyroscope` from 2.0.5 to 2.0.6 - [Release notes](https://github.com/grafana/pyroscope-rs/releases) - [Changelog](https://github.com/grafana/pyroscope-rs/blob/main/CHANGELOG.md) - [Commits](https://github.com/grafana/pyroscope-rs/compare/lib-2.0.5...lib-2.0.6) --- updated-dependencies: - dependency-name: hyper dependency-version: 1.10.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: serial_test dependency-version: 3.5.0 dependency-type: direct:production update-type: version-update:semver-minor dependency-group: dependencies - dependency-name: snafu dependency-version: 0.9.1 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: uuid dependency-version: 1.23.2 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: dial9-tokio-telemetry dependency-version: 0.3.13 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies - dependency-name: pyroscope dependency-version: 2.0.6 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: dependencies ... Signed-off-by: dependabot[bot] <support@github.com> * fix(profiling): pin pyroscope to 2.0.5, add jemalloc memory profiling, unify platform gates Pin pyroscope to =2.0.5 to avoid duplicate `perf_signal_handler` symbol caused by 2.0.6 vendoring pprof-rs internally. 2.0.5 depends on external pprof-pyroscope-fork (v0.1500.4), which Cargo unifies with the workspace's pprof-pyroscope-fork — a single symbol instance, no linker collision. Add jemalloc_backend for continuous memory profiling export to Pyroscope, alongside the existing pprof-based CPU profiling. Both CPU and memory profiling now work on linux and macos. Unify platform gates from `cfg(all(target_os = "linux", target_env = "gnu", target_arch = "x86_64"))` to `cfg(any(target_os = "linux", target_os = "macos"))`, switching macOS global allocator from mimalloc to jemalloc. * style: format cfg attributes in allocator_reclaim.rs * chore(deps): ignore pyroscope 2.x in dependabot, add profile_type tag Add pyroscope 2.x to dependabot ignore list to prevent auto-upgrade past 2.0.5 (>=2.0.6 vendors pprof-rs, causing duplicate symbol conflict). Add profile_type=cpu tag to CPU profiling agent for differentiation from memory profiling agent in Pyroscope UI. --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: houseme <housemecn@gmail.com>
This commit is contained in:
@@ -72,7 +72,8 @@ sysinfo = { workspace = true }
|
||||
nvml-wrapper = { workspace = true, optional = true }
|
||||
|
||||
[target.'cfg(any(target_os = "linux", target_os = "macos"))'.dependencies]
|
||||
pyroscope = { workspace = true, features = ["backend-pprof-rs"] }
|
||||
pyroscope = { workspace = true }
|
||||
jemalloc_pprof = { workspace = true }
|
||||
|
||||
|
||||
[dev-dependencies]
|
||||
|
||||
@@ -43,6 +43,8 @@ pub struct OtelGuard {
|
||||
pub(crate) logger_provider: Option<SdkLoggerProvider>,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
pub(crate) profiling_agent: Option<pyroscope::PyroscopeAgent<pyroscope::pyroscope::PyroscopeAgentRunning>>,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
pub(crate) memory_profiling_agent: Option<pyroscope::PyroscopeAgent<pyroscope::pyroscope::PyroscopeAgentRunning>>,
|
||||
/// Handle to the background log-cleanup task; aborted on drop.
|
||||
pub(crate) cleanup_handle: Option<tokio::task::JoinHandle<()>>,
|
||||
/// Worker guard that keeps the non-blocking `tracing_appender` thread
|
||||
@@ -60,6 +62,8 @@ impl std::fmt::Debug for OtelGuard {
|
||||
.field("logger_provider", &self.logger_provider.is_some());
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
s.field("profiling_agent", &self.profiling_agent.is_some());
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
s.field("memory_profiling_agent", &self.memory_profiling_agent.is_some());
|
||||
s.field("cleanup_handle", &self.cleanup_handle.is_some())
|
||||
.field("tracing_guard", &self.tracing_guard.is_some())
|
||||
.field("stdout_guard", &self.stdout_guard.is_some())
|
||||
@@ -101,6 +105,16 @@ impl Drop for OtelGuard {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
if let Some(agent) = self.memory_profiling_agent.take() {
|
||||
match agent.stop() {
|
||||
Err(err) => eprintln!("Memory profiling agent stop error: {err:?}"),
|
||||
Ok(stopped) => {
|
||||
stopped.shutdown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if let Some(handle) = self.cleanup_handle.take() {
|
||||
handle.abort();
|
||||
eprintln!("Log cleanup task stopped");
|
||||
|
||||
@@ -157,6 +157,8 @@ fn init_stdout_only(_config: &OtelConfig, logger_level: &str, is_production: boo
|
||||
logger_provider: None,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
profiling_agent: None,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
memory_profiling_agent: None,
|
||||
tracing_guard: Some(guard),
|
||||
stdout_guard: None,
|
||||
cleanup_handle: None,
|
||||
@@ -291,6 +293,8 @@ fn init_file_logging_internal(
|
||||
logger_provider: None,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
profiling_agent: None,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
memory_profiling_agent: None,
|
||||
tracing_guard: Some(guard),
|
||||
stdout_guard,
|
||||
cleanup_handle: Some(cleanup_handle),
|
||||
|
||||
@@ -167,6 +167,9 @@ pub(super) fn init_observability_http(
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
let profiling_agent = init_profiler(config);
|
||||
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
let memory_profiling_agent = init_memory_profiler(config);
|
||||
|
||||
// ── Logger Logic ──────────────────────────────────────────────────────────
|
||||
// Logging is the only signal that may intentionally route to either OTLP
|
||||
// or local files depending on configuration completeness.
|
||||
@@ -316,6 +319,8 @@ pub(super) fn init_observability_http(
|
||||
logger_provider,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
profiling_agent,
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
memory_profiling_agent,
|
||||
tracing_guard,
|
||||
stdout_guard,
|
||||
cleanup_handle,
|
||||
@@ -516,7 +521,7 @@ fn init_profiler(config: &OtelConfig) -> Option<pyroscope::PyroscopeAgent<pyrosc
|
||||
let sample_rate = 100; // 100 Hz
|
||||
|
||||
let agent = PyroscopeAgentBuilder::new(endpoint, service_name, sample_rate, "pyroscope-rs", "1.0.1", backend)
|
||||
.tags(vec![("version", version)]) // TODO: add git commit tag
|
||||
.tags(vec![("version", version), ("profile_type", "cpu")])
|
||||
.build()
|
||||
.ok()?;
|
||||
|
||||
@@ -529,6 +534,60 @@ fn init_profiler(config: &OtelConfig) -> Option<pyroscope::PyroscopeAgent<pyrosc
|
||||
}
|
||||
}
|
||||
|
||||
/// Initialise a Pyroscope agent for continuous **memory** profiling via jemalloc.
|
||||
///
|
||||
/// This is only available on `linux + gnu + x86_64` where tikv-jemallocator
|
||||
/// is the global allocator and `jemalloc_pprof::PROF_CTL` is accessible.
|
||||
///
|
||||
/// Returns `None` when profiling export is disabled, the endpoint is missing,
|
||||
/// jemalloc profiling is not activated, or the agent fails to build/start.
|
||||
#[cfg(any(target_os = "linux", target_os = "macos"))]
|
||||
fn init_memory_profiler(config: &OtelConfig) -> Option<pyroscope::PyroscopeAgent<pyroscope::pyroscope::PyroscopeAgentRunning>> {
|
||||
use pyroscope::backend::jemalloc_backend;
|
||||
use pyroscope::pyroscope::PyroscopeAgentBuilder;
|
||||
use rustfs_config::VERSION;
|
||||
|
||||
if !config
|
||||
.profiling_export_enabled
|
||||
.unwrap_or(rustfs_config::DEFAULT_OBS_PROFILING_EXPORT_ENABLED)
|
||||
{
|
||||
return None;
|
||||
}
|
||||
|
||||
let endpoint = config.profiling_endpoint.as_ref()?.as_str();
|
||||
if endpoint.is_empty() {
|
||||
return None;
|
||||
}
|
||||
|
||||
// Verify jemalloc profiling is available and activated
|
||||
{
|
||||
let prof_ctl = jemalloc_pprof::PROF_CTL.as_ref()?;
|
||||
let ctl = prof_ctl.try_lock().ok()?;
|
||||
if !ctl.activated() {
|
||||
eprintln!("Memory profiling skipped: jemalloc profiling is not activated");
|
||||
return None;
|
||||
}
|
||||
}
|
||||
|
||||
let backend = jemalloc_backend();
|
||||
let service_name = config.service_name.as_deref().unwrap_or(APP_NAME);
|
||||
let version = config.service_version.as_deref().unwrap_or(VERSION);
|
||||
let sample_rate = 100;
|
||||
|
||||
let agent = PyroscopeAgentBuilder::new(endpoint, service_name, sample_rate, "pyroscope-rs", "1.0.1", backend)
|
||||
.tags(vec![("version", version), ("profile_type", "memory")])
|
||||
.build()
|
||||
.ok()?;
|
||||
|
||||
match agent.start() {
|
||||
Ok(agent) => Some(agent),
|
||||
Err(err) => {
|
||||
eprintln!("Memory profiling agent start error: {err:?}");
|
||||
None
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Create a stdout periodic metrics reader for the given interval.
|
||||
///
|
||||
/// This helper is primarily used for local development and diagnostics when
|
||||
|
||||
Reference in New Issue
Block a user