From 465231300ddc143cbe57f288504fd3454c94ac8a Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 15 Dec 2025 10:44:40 -0600 Subject: [PATCH 1/3] chore: add ingress rpc metrics --- crates/ingress-rpc/src/metrics.rs | 18 ++++++++++++++++++ crates/ingress-rpc/src/service.rs | 14 ++++++++++++-- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/crates/ingress-rpc/src/metrics.rs b/crates/ingress-rpc/src/metrics.rs index 1b7c8a5..c899b56 100644 --- a/crates/ingress-rpc/src/metrics.rs +++ b/crates/ingress-rpc/src/metrics.rs @@ -18,6 +18,24 @@ pub fn record_histogram(rpc_latency: Duration, rpc: String) { #[derive(Metrics, Clone)] #[metrics(scope = "tips_ingress_rpc")] pub struct Metrics { + #[metric(describe = "Number of valid transactions received")] + pub transactions_received: Counter, + + #[metric(describe = "Number of valid bundles parsed")] + pub bundles_parsed: Counter, + + #[metric(describe = "Number of bundles simulated")] + pub successful_simulations: Counter, + + #[metric(describe = "Number of bundles simulated")] + pub failed_simulations: Counter, + + #[metric(describe = "Number of bundles sent to kafka")] + pub sent_to_kafka: Counter, + + #[metric(describe = "Number of transactions sent to mempool")] + pub sent_to_mempool: Counter, + #[metric(describe = "Duration of validate_tx")] pub validate_tx_duration: Histogram, diff --git a/crates/ingress-rpc/src/service.rs b/crates/ingress-rpc/src/service.rs index 1a2f9d0..d02b95e 100644 --- a/crates/ingress-rpc/src/service.rs +++ b/crates/ingress-rpc/src/service.rs @@ -202,6 +202,8 @@ impl IngressApiServer for IngressService { let start = Instant::now(); let transaction = self.get_tx(&data).await?; + self.metrics.transactions_received.increment(1); + let send_to_kafka = matches!( self.tx_submission_method, TxSubmissionMethod::Kafka | TxSubmissionMethod::MempoolAndKafka @@ -223,6 +225,7 @@ impl IngressApiServer for IngressService { reverting_tx_hashes: vec![transaction.tx_hash()], ..Default::default() }; + let parsed_bundle: ParsedBundle = bundle .clone() .try_into() @@ -230,10 +233,15 @@ impl IngressApiServer for IngressService { let bundle_hash = &parsed_bundle.bundle_hash(); + self.metrics.bundles_parsed.increment(1); + let meter_bundle_response = self.meter_bundle(&bundle, bundle_hash).await.ok(); if let Some(meter_info) = meter_bundle_response.as_ref() { + self.metrics.successful_simulations.increment(1); _ = self.builder_tx.send(meter_info.clone()); + } else { + self.metrics.failed_simulations.increment(1); } let accepted_bundle = @@ -248,7 +256,8 @@ impl IngressApiServer for IngressService { warn!(message = "Failed to publish Queue::enqueue_bundle", bundle_hash = %bundle_hash, error = %e); } - info!(message="queued singleton bundle", txn_hash=%transaction.tx_hash()); + self.metrics.sent_to_kafka.increment(1); + debug!(message="queued singleton bundle", txn_hash=%transaction.tx_hash()); } if send_to_mempool { @@ -258,6 +267,7 @@ impl IngressApiServer for IngressService { .await; match response { Ok(_) => { + self.metrics.sent_to_mempool.increment(1); debug!(message = "sent transaction to the mempool", hash=%transaction.tx_hash()); } Err(e) => { @@ -285,7 +295,7 @@ impl IngressApiServer for IngressService { }); } - debug!( + info!( message = "processed transaction", bundle_hash = %bundle_hash, transaction_hash = %transaction.tx_hash(), From 644adcb564747f74df045f81424b954a6b5fb76e Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 15 Dec 2025 11:03:16 -0600 Subject: [PATCH 2/3] bump logs --- crates/ingress-rpc/src/service.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ingress-rpc/src/service.rs b/crates/ingress-rpc/src/service.rs index d02b95e..b54994c 100644 --- a/crates/ingress-rpc/src/service.rs +++ b/crates/ingress-rpc/src/service.rs @@ -257,7 +257,7 @@ impl IngressApiServer for IngressService { } self.metrics.sent_to_kafka.increment(1); - debug!(message="queued singleton bundle", txn_hash=%transaction.tx_hash()); + info!(message="queued singleton bundle", txn_hash=%transaction.tx_hash()); } if send_to_mempool { From 8d0d0a847d1538c8f7a1bcce8197abcbe3358b64 Mon Sep 17 00:00:00 2001 From: Danyal Prout Date: Mon, 15 Dec 2025 11:31:09 -0600 Subject: [PATCH 3/3] remove non error log --- ui/src/lib/s3.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ui/src/lib/s3.ts b/ui/src/lib/s3.ts index 229fdad..4b0263a 100644 --- a/ui/src/lib/s3.ts +++ b/ui/src/lib/s3.ts @@ -60,7 +60,6 @@ async function getObjectContent(key: string): Promise { const body = await response.Body?.transformToString(); return body || null; } catch (error) { - console.error(`Failed to get S3 object ${key}:`, error); return null; } }