Skip to content

Commit 20198a9

Browse files
authored
Remove prometheus dependency and metrics (#769)
## Summary - Remove the `prometheus` crate dependency from the workspace and `xet_data` - Delete `prometheus_metrics.rs` which defined 3 IntCounter metrics (CAS bytes produced, bytes cleaned, bytes smudged) - Remove metric increment calls from `file_upload_session.rs` and `file_download_session.rs` - Fix Windows CI flake: redb "Database already open" error in `test_single_large` These metrics were collected but never exposed via any HTTP endpoint or text encoder, making them effectively dead code. ## Test plan - [x] `cargo +nightly fmt` — clean - [x] `cargo clippy --all-targets` — no new warnings - [x] `cargo test -p xet-data` — 17/17 pass - [x] `cargo test -p xet-data --features simulation --test test_clean_smudge` — 14/14 pass (including `test_single_large`) - [x] WASM builds (`hf_xet_wasm`, `hf_xet_thin_wasm`) — both succeed <!-- CURSOR_SUMMARY --> --- > [!NOTE] > **Low Risk** > Low risk: this removes unused Prometheus metrics plumbing and related dependencies without changing the core upload/download logic. Main risk is loss of any downstream reliance on these counters at build time (e.g., feature flags or imports). > > **Overview** > Removes the `prometheus` dependency from the workspace and `xet_data`, and updates lockfiles accordingly (including WASM-related lockfiles). > > Deletes `xet_data`’s `prometheus_metrics` module and strips the associated counter increments from `FileUploadSession` and `FileDownloadSession`, leaving the data processing behavior unchanged aside from no longer recording these metrics. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit c6c866b. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
1 parent 3d377bd commit 20198a9

10 files changed

Lines changed: 5 additions & 183 deletions

File tree

Cargo.lock

Lines changed: 0 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@ more-asserts = "0.3"
7878
oneshot = "0.1"
7979
pin-project = "1"
8080
pyo3 = { version = "0.26", features = ["abi3-py37", "multiple-pymethods"] }
81-
prometheus = "0.14"
8281
rand = "0.9"
8382
rand_chacha = "0.9"
8483
regex = "1"

hf_xet/Cargo.lock

Lines changed: 3 additions & 39 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wasm/hf_xet_thin_wasm/Cargo.lock

Lines changed: 0 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

wasm/hf_xet_wasm/Cargo.lock

Lines changed: 0 additions & 42 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

xet_data/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ http = { workspace = true }
2626
itertools = { workspace = true }
2727
lazy_static = { workspace = true }
2828
more-asserts = { workspace = true }
29-
prometheus = { workspace = true }
3029
rand = { workspace = true }
3130
serde = { workspace = true }
3231
serde_json = { workspace = true }

xet_data/src/processing/file_download_session.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ use xet_client::cas_types::FileRange;
1313
use xet_client::chunk_cache::ChunkCache;
1414
use xet_runtime::core::{XetRuntime, xet_config};
1515

16+
use super::XetFileInfo;
1617
use super::configurations::TranslatorConfig;
1718
use super::remote_client_interface::create_remote_client;
18-
use super::{XetFileInfo, prometheus_metrics};
1919
use crate::error::{DataError, Result};
2020
use crate::file_reconstruction::{DownloadStream, FileReconstructor, UnorderedDownloadStream};
2121
use crate::progress_tracking::{GroupProgress, ItemProgressUpdater, UniqueID};
@@ -143,7 +143,6 @@ impl FileDownloadSession {
143143
actual: n_bytes,
144144
});
145145
}
146-
prometheus_metrics::FILTER_BYTES_SMUDGED.inc_by(n_bytes);
147146
Ok(n_bytes)
148147
}
149148

@@ -189,7 +188,6 @@ impl FileDownloadSession {
189188
});
190189
}
191190

192-
prometheus_metrics::FILTER_BYTES_SMUDGED.inc_by(n_bytes);
193191
Ok((id, n_bytes))
194192
}
195193

xet_data/src/processing/file_upload_session.rs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ use xet_core_structures::metadata_shard::file_structs::MDBFileInfo;
1717
use xet_core_structures::xorb_object::SerializedXorbObject;
1818
use xet_runtime::core::{XetRuntime, xet_config};
1919

20+
use super::XetFileInfo;
2021
use super::configurations::TranslatorConfig;
2122
use super::file_cleaner::{Sha256Policy, SingleFileCleaner};
2223
use super::remote_client_interface::create_remote_client;
2324
use super::shard_interface::SessionShardInterface;
24-
use super::{XetFileInfo, prometheus_metrics};
2525
use crate::deduplication::constants::{
2626
MAX_XORB_BYTES, MAX_XORB_CHUNKS, XORB_CUT_THRESHOLD_BYTES, XORB_CUT_THRESHOLD_CHUNKS,
2727
};
@@ -503,10 +503,6 @@ impl FileUploadSession {
503503
metrics.shard_bytes_uploaded = self.shard_interface.upload_and_register_session_shards().await?;
504504
metrics.total_bytes_uploaded = metrics.shard_bytes_uploaded + metrics.xorb_bytes_uploaded;
505505

506-
// Update the global counters
507-
prometheus_metrics::FILTER_CAS_BYTES_PRODUCED.inc_by(metrics.new_bytes);
508-
prometheus_metrics::FILTER_BYTES_CLEANED.inc_by(metrics.total_bytes);
509-
510506
#[cfg(debug_assertions)]
511507
{
512508
self.completion_tracker.assert_complete();

xet_data/src/processing/mod.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ mod file_cleaner;
55
mod file_download_session;
66
mod file_upload_session;
77
pub mod migration_tool;
8-
mod prometheus_metrics;
98
mod remote_client_interface;
109
mod sha256;
1110
mod shard_interface;

xet_data/src/processing/prometheus_metrics.rs

Lines changed: 0 additions & 13 deletions
This file was deleted.

0 commit comments

Comments
 (0)