diff --git a/chain/client/src/chunk_inclusion_tracker.rs b/chain/client/src/chunk_inclusion_tracker.rs index ec1469000eb..ac80a720f21 100644 --- a/chain/client/src/chunk_inclusion_tracker.rs +++ b/chain/client/src/chunk_inclusion_tracker.rs @@ -233,6 +233,11 @@ impl ChunkInclusionTracker { (stats.total_validators_count.saturating_sub(stats.endorsed_validators_count)) as f64, ); + if !stats.is_endorsed { + metrics::BLOCK_PRODUCER_INSUFFICIENT_ENDORSEMENT_CHUNK_COUNT + .with_label_values(label_values) + .inc(); + } } } } diff --git a/chain/client/src/metrics.rs b/chain/client/src/metrics.rs index d40d3422ad2..c774a3eab8c 100644 --- a/chain/client/src/metrics.rs +++ b/chain/client/src/metrics.rs @@ -602,6 +602,16 @@ pub(crate) static ORPHAN_CHUNK_STATE_WITNESS_POOL_MEMORY_USED: LazyLock = + LazyLock::new(|| { + try_create_counter_vec( + "near_block_producer_insufficient_endorsement_chunk_count", + "Number of chunks excluded from the block due to insufficient chunk endorsements", + &["shard_id"], + ) + .unwrap() + }); + pub(crate) static BLOCK_PRODUCER_ENDORSED_STAKE_RATIO: LazyLock = LazyLock::new(|| { try_create_histogram_vec(