diff --git a/block-streamer/src/block_stream.rs b/block-streamer/src/block_stream.rs index eff2a0d1..a9af3f10 100644 --- a/block-streamer/src/block_stream.rs +++ b/block-streamer/src/block_stream.rs @@ -409,9 +409,14 @@ async fn process_bitmap_indexer_blocks( let mut last_published_block_height: u64 = start_block_height; + let indexer_name = indexer.get_full_name(); + while let Some(block_height_result) = matching_block_heights.next().await { match block_height_result { Ok(block_height) => { + metrics::RECEIVER_BLOCKS_FAILURE + .with_label_values(&[&indexer_name]) + .set(0); redis .publish_block(indexer, redis_stream.clone(), block_height, MAX_STREAM_SIZE) .await?; @@ -422,6 +427,9 @@ async fn process_bitmap_indexer_blocks( last_published_block_height = block_height; } Err(err) => { + metrics::RECEIVER_BLOCKS_FAILURE + .with_label_values(&[&indexer_name]) + .inc(); tracing::error!( "Backfill using bitmap indexer failed unexpectedly: {:?}", err diff --git a/block-streamer/src/graphql/client.rs b/block-streamer/src/graphql/client.rs index 38aad637..516f2b3c 100644 --- a/block-streamer/src/graphql/client.rs +++ b/block-streamer/src/graphql/client.rs @@ -57,6 +57,12 @@ impl GraphQLClientImpl { .json(&body) .send() .await?; + if reqwest_response.status() != 200 { + tracing::error!( + "GraphQL query failed with status code: {}", + reqwest_response.status() + ); + } reqwest_response.json().await } diff --git a/block-streamer/src/metrics.rs b/block-streamer/src/metrics.rs index 1f01a071..ec166e83 100644 --- a/block-streamer/src/metrics.rs +++ b/block-streamer/src/metrics.rs @@ -63,6 +63,12 @@ lazy_static! { &["indexer"] ) .unwrap(); + pub static ref RECEIVER_BLOCKS_FAILURE: IntGaugeVec = register_int_gauge_vec!( + "queryapi_block_streamer_receiver_blocks_failure", + "Gauge which only has a nonzero value if an error occurs during receiver block backfill", + &["indexer"] + ) + .unwrap(); } pub struct LogCounter;