Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add metric for number of chunks excluded from the block due to insufficient endorsement #12562

Merged
merged 1 commit into from
Dec 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions chain/client/src/chunk_inclusion_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
}
}
}
10 changes: 10 additions & 0 deletions chain/client/src/metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -602,6 +602,16 @@ pub(crate) static ORPHAN_CHUNK_STATE_WITNESS_POOL_MEMORY_USED: LazyLock<IntGauge
.unwrap()
});

pub(crate) static BLOCK_PRODUCER_INSUFFICIENT_ENDORSEMENT_CHUNK_COUNT: LazyLock<CounterVec> =
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<HistogramVec> =
LazyLock::new(|| {
try_create_histogram_vec(
Expand Down
Loading