diff --git a/block-streamer/src/block_stream.rs b/block-streamer/src/block_stream.rs index 44ad66d46..112694788 100644 --- a/block-streamer/src/block_stream.rs +++ b/block-streamer/src/block_stream.rs @@ -116,6 +116,7 @@ impl BlockStream { } } +#[allow(clippy::too_many_arguments)] #[tracing::instrument( skip_all, fields( diff --git a/block-streamer/src/lake_s3_client.rs b/block-streamer/src/lake_s3_client.rs index dea968383..0bd056e87 100644 --- a/block-streamer/src/lake_s3_client.rs +++ b/block-streamer/src/lake_s3_client.rs @@ -1,6 +1,10 @@ +#![cfg_attr(test, allow(dead_code))] + use async_trait::async_trait; use near_lake_framework::s3_client::{GetObjectBytesError, ListCommonPrefixesError}; +use crate::metrics; + #[cfg(not(test))] pub use LakeS3ClientImpl as LakeS3Client; #[cfg(test)] @@ -30,6 +34,8 @@ impl near_lake_framework::s3_client::S3Client for LakeS3ClientImpl { bucket: &str, prefix: &str, ) -> Result, GetObjectBytesError> { + metrics::LAKE_S3_GET_REQUEST_COUNT.inc(); + let object = self .s3_client .get_object() diff --git a/block-streamer/src/metrics.rs b/block-streamer/src/metrics.rs index 0c691f17e..cbaef0c9d 100644 --- a/block-streamer/src/metrics.rs +++ b/block-streamer/src/metrics.rs @@ -1,12 +1,18 @@ use actix_web::{get, App, HttpServer, Responder}; use lazy_static::lazy_static; use prometheus::{ - register_int_counter_vec, register_int_gauge_vec, Encoder, IntCounterVec, IntGaugeVec, + register_int_counter, register_int_counter_vec, register_int_gauge_vec, Encoder, IntCounter, + IntCounterVec, IntGaugeVec, }; use tracing_subscriber::layer::Context; use tracing_subscriber::Layer; lazy_static! { + pub static ref LAKE_S3_GET_REQUEST_COUNT: IntCounter = register_int_counter!( + "queryapi_block_streamer_lake_s3_get_request_count", + "Number of requests made to S3 from near lake framework", + ) + .unwrap(); pub static ref LAST_PROCESSED_BLOCK: IntGaugeVec = register_int_gauge_vec!( "queryapi_block_streamer_last_processed_block", "Height of last block seen",