From 032ee3052c7f8fb9d8a475f71439668f9310c782 Mon Sep 17 00:00:00 2001 From: MasterPtato Date: Tue, 1 Jul 2025 19:08:25 +0000 Subject: [PATCH] fix: reduce cardinality of metrics --- packages/common/pools/src/db/sqlite/mod.rs | 4 ++-- packages/common/pools/src/metrics.rs | 4 ++-- .../server/install/install_scripts/components/vector.rs | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/packages/common/pools/src/db/sqlite/mod.rs b/packages/common/pools/src/db/sqlite/mod.rs index a8fbb34a18..2c6d5e7ba2 100644 --- a/packages/common/pools/src/db/sqlite/mod.rs +++ b/packages/common/pools/src/db/sqlite/mod.rs @@ -515,7 +515,7 @@ impl SqlitePoolManager { // by calculating the size ratio let ratio = data.len() as f64 / total_data_size; metrics::SQLITE_UPLOAD_DB_RATE - .with_label_values(&[&hex_key]) + .with_label_values(&[]) .set(data.len() as f64 / (dt * ratio)); } @@ -707,7 +707,7 @@ impl SqlitePoolManager { let dt = start_instant.elapsed(); metrics::SQLITE_DOWNLOAD_DB_RATE - .with_label_values(&[&hex_key]) + .with_label_values(&[]) .set(data_len as f64 / dt.as_secs_f64()); Ok(true) diff --git a/packages/common/pools/src/metrics.rs b/packages/common/pools/src/metrics.rs index e45a5f126b..1f55e2960e 100644 --- a/packages/common/pools/src/metrics.rs +++ b/packages/common/pools/src/metrics.rs @@ -74,14 +74,14 @@ lazy_static::lazy_static! { pub static ref SQLITE_UPLOAD_DB_RATE: GaugeVec = register_gauge_vec_with_registry!( "sqlite_upload_db_rate", "Rate to read and upload to FDB an sqlite DB in bytes/s.", - &["key"], + &[], *REGISTRY, ) .unwrap(); pub static ref SQLITE_DOWNLOAD_DB_RATE: GaugeVec = register_gauge_vec_with_registry!( "sqlite_download_db_rate", "Rate to download and write to file an sqlite DB from FDB in bytes/s.", - &["key"], + &[], *REGISTRY, ) .unwrap(); diff --git a/packages/core/services/cluster/src/workflows/server/install/install_scripts/components/vector.rs b/packages/core/services/cluster/src/workflows/server/install/install_scripts/components/vector.rs index 752fc08017..acfda43a8b 100644 --- a/packages/core/services/cluster/src/workflows/server/install/install_scripts/components/vector.rs +++ b/packages/core/services/cluster/src/workflows/server/install/install_scripts/components/vector.rs @@ -71,10 +71,10 @@ pub fn configure(namespace: &str, config: &Config, pool_type: PoolType) -> Globa }, "compression": true, - //Buffer to disk for durability & reduce memory usage + // Buffer to disk for durability & reduce memory usage "buffer": { "type": "disk", - "max_size": 268435488, // 256 MB + "max_size": 2 * 1024 * 1024 * 1024, // 2 GiB "when_full": "block" } }