feat(metrics): configurable jeprof pprof dumps directory (#20834)

This commit is contained in:
Alexey Shekhirin
2026-01-08 11:21:42 +00:00
committed by GitHub
parent 0f0a181fe2
commit bcd74d021b
40 changed files with 176 additions and 12 deletions

View File

@@ -31,6 +31,10 @@ pub struct DatadirArgs {
/// The absolute path to store `RocksDB` database in.
#[arg(long = "datadir.rocksdb", value_name = "PATH", verbatim_doc_comment)]
pub rocksdb_path: Option<PathBuf>,
/// The absolute path to store pprof dumps in.
#[arg(long = "datadir.pprof-dumps", value_name = "PATH", verbatim_doc_comment)]
pub pprof_dumps_path: Option<PathBuf>,
}
impl DatadirArgs {

View File

@@ -313,6 +313,18 @@ impl<D> ChainPath<D> {
}
}
/// Returns the path to the directory for storing pprof dumps for this chain.
///
/// `<DIR>/<CHAIN_ID>/pprof`
pub fn pprof_dumps(&self) -> PathBuf {
let datadir_args = &self.2;
if let Some(pprof_dumps_path) = &datadir_args.pprof_dumps_path {
pprof_dumps_path.clone()
} else {
self.data_dir().join("pprof")
}
}
/// Returns the path to the reth p2p secret key for this chain.
///
/// `<DIR>/<CHAIN_ID>/discovery-secret`