From 5c9e8ed3f6076154f8512b01edbfd6d39d8c3da6 Mon Sep 17 00:00:00 2001 From: Giems <109511301+Giems@users.noreply.github.com> Date: Tue, 9 Jul 2024 09:01:34 +0200 Subject: [PATCH] remove metrics from IndexerExecutor --- crates/sui-bridge-indexer/src/main.rs | 2 +- crates/sui-data-ingestion-core/src/executor.rs | 14 ++++++++------ crates/sui-data-ingestion-core/src/tests.rs | 2 +- crates/sui-data-ingestion/src/main.rs | 15 ++++++++------- crates/sui-indexer/src/indexer.rs | 2 +- crates/suins-indexer/src/main.rs | 9 +++++---- 6 files changed, 24 insertions(+), 20 deletions(-) diff --git a/crates/sui-bridge-indexer/src/main.rs b/crates/sui-bridge-indexer/src/main.rs index b536ce16796b2..c4f3059394a7d 100644 --- a/crates/sui-bridge-indexer/src/main.rs +++ b/crates/sui-bridge-indexer/src/main.rs @@ -92,7 +92,7 @@ async fn start_processing_sui_checkpoints( let mut executor = IndexerExecutor::new( progress_store, 1, /* workflow types */ - ingestion_metrics, + // ingestion_metrics, ); let indexer_metrics_cloned = indexer_meterics.clone(); diff --git a/crates/sui-data-ingestion-core/src/executor.rs b/crates/sui-data-ingestion-core/src/executor.rs index 92bfda006852a..4ad9cde1213ec 100644 --- a/crates/sui-data-ingestion-core/src/executor.rs +++ b/crates/sui-data-ingestion-core/src/executor.rs @@ -27,11 +27,12 @@ pub struct IndexerExecutor

{ progress_store: ProgressStoreWrapper

, pool_progress_sender: mpsc::Sender<(String, CheckpointSequenceNumber)>, pool_progress_receiver: mpsc::Receiver<(String, CheckpointSequenceNumber)>, - metrics: DataIngestionMetrics, + // metrics: DataIngestionMetrics, } impl IndexerExecutor

{ - pub fn new(progress_store: P, number_of_jobs: usize, metrics: DataIngestionMetrics) -> Self { + // pub fn new(progress_store: P, number_of_jobs: usize, metrics: DataIngestionMetrics) -> Self { + pub fn new(progress_store: P, number_of_jobs: usize) -> Self { let (pool_progress_sender, pool_progress_receiver) = mpsc::channel(number_of_jobs * MAX_CHECKPOINTS_IN_PROGRESS); Self { @@ -40,7 +41,7 @@ impl IndexerExecutor

{ progress_store: ProgressStoreWrapper::new(progress_store), pool_progress_sender, pool_progress_receiver, - metrics, + // metrics, } } @@ -90,7 +91,7 @@ impl IndexerExecutor

{ gc_sender.send(seq_number).await?; reader_checkpoint_number = seq_number; } - self.metrics.data_ingestion_checkpoint.with_label_values(&[&task_name]).set(sequence_number as i64); + // self.metrics.data_ingestion_checkpoint.with_label_values(&[&task_name]).set(sequence_number as i64); } Some(checkpoint) = checkpoint_recv.recv() => { for sender in &self.pool_senders { @@ -114,9 +115,10 @@ pub async fn setup_single_workflow( oneshot::Sender<()>, )> { let (exit_sender, exit_receiver) = oneshot::channel(); - let metrics = DataIngestionMetrics::new(&Registry::new()); + // let metrics = DataIngestionMetrics::new(&Registry::new()); let progress_store = ShimProgressStore(initial_checkpoint_number); - let mut executor = IndexerExecutor::new(progress_store, 1, metrics); + // let mut executor = IndexerExecutor::new(progress_store, 1, metrics); + let mut executor = IndexerExecutor::new(progress_store, 1); let worker_pool = WorkerPool::new(worker, "workflow".to_string(), concurrency); executor.register(worker_pool).await?; Ok(( diff --git a/crates/sui-data-ingestion-core/src/tests.rs b/crates/sui-data-ingestion-core/src/tests.rs index 2845ff09494a0..863ca82f0d20d 100644 --- a/crates/sui-data-ingestion-core/src/tests.rs +++ b/crates/sui-data-ingestion-core/src/tests.rs @@ -119,7 +119,7 @@ fn create_executor_bundle() -> ExecutorBundle { let executor = IndexerExecutor::new( progress_store, 1, - DataIngestionMetrics::new(&Registry::new()), + // DataIngestionMetrics::new(&Registry::new()), ); ExecutorBundle { executor, diff --git a/crates/sui-data-ingestion/src/main.rs b/crates/sui-data-ingestion/src/main.rs index a55ad5535c5ec..744179a714ba9 100644 --- a/crates/sui-data-ingestion/src/main.rs +++ b/crates/sui-data-ingestion/src/main.rs @@ -100,12 +100,12 @@ async fn main() -> Result<()> { let _guard = telemetry_subscribers::TelemetryConfig::new() .with_env() .init(); - let registry_service = mysten_metrics::start_prometheus_server( - format!("{}:{}", config.metrics_host, config.metrics_port).parse()?, - ); - let registry: Registry = registry_service.default_registry(); - mysten_metrics::init_metrics(®istry); - let metrics = DataIngestionMetrics::new(®istry); + // let registry_service = mysten_metrics::start_prometheus_server( + // format!("{}:{}", config.metrics_host, config.metrics_port).parse()?, + // ); + // let registry: Registry = registry_service.default_registry(); + // mysten_metrics::init_metrics(®istry); + // let metrics = DataIngestionMetrics::new(®istry); let progress_store = DynamoDBProgressStore::new( &config.progress_store.aws_access_key_id, @@ -114,7 +114,8 @@ async fn main() -> Result<()> { config.progress_store.table_name, ) .await; - let mut executor = IndexerExecutor::new(progress_store, config.tasks.len(), metrics); + // let mut executor = IndexerExecutor::new(progress_store, config.tasks.len(), metrics); + let mut executor = IndexerExecutor::new(progress_store, config.tasks.len()); for task_config in config.tasks { match task_config.task { Task::Archival(archival_config) => { diff --git a/crates/sui-indexer/src/indexer.rs b/crates/sui-indexer/src/indexer.rs index 6fede882c949f..5a8080fbb5ed4 100644 --- a/crates/sui-indexer/src/indexer.rs +++ b/crates/sui-indexer/src/indexer.rs @@ -122,7 +122,7 @@ impl Indexer { ("object_snapshot".to_string(), object_snapshot_watermark), ]), 1, - DataIngestionMetrics::new(&Registry::new()), + // DataIngestionMetrics::new(&Registry::new()), ); let worker = new_handlers::(store, metrics, primary_watermark, cancel.clone()).await?; diff --git a/crates/suins-indexer/src/main.rs b/crates/suins-indexer/src/main.rs index 16aa4937a4e3c..53044b9a8417d 100644 --- a/crates/suins-indexer/src/main.rs +++ b/crates/suins-indexer/src/main.rs @@ -132,10 +132,11 @@ async fn main() -> Result<()> { let (_exit_sender, exit_receiver) = oneshot::channel(); let progress_store = FileProgressStore::new(PathBuf::from(backfill_progress_file_path)); - let registry: Registry = start_basic_prometheus_server(); - mysten_metrics::init_metrics(®istry); - let metrics = DataIngestionMetrics::new(®istry); - let mut executor = IndexerExecutor::new(progress_store, 1, metrics); + // let registry: Registry = start_basic_prometheus_server(); + // mysten_metrics::init_metrics(®istry); + // let metrics = DataIngestionMetrics::new(®istry); + // let mut executor = IndexerExecutor::new(progress_store, 1, metrics); + let mut executor = IndexerExecutor::new(progress_store, 1); let indexer_setup = if let (Some(registry_id), Some(subdomain_wrapper_type), Some(name_record_type)) =