Get blobs v2 metrics (#8641)

N/A


  Add standardized metrics for getBlobsV2 from https://github.com/ethereum/beacon-metrics/pull/14.


Co-Authored-By: Pawan Dhananjay <pawandhananjay@gmail.com>
This commit is contained in:
Pawan Dhananjay
2026-01-13 13:20:40 +05:30
committed by GitHub
parent 57bbc93d75
commit c91345782a
2 changed files with 38 additions and 0 deletions

View File

@@ -247,6 +247,12 @@ async fn fetch_and_process_blobs_v2<T: BeaconChainTypes>(
metrics::observe(&metrics::BLOBS_FROM_EL_EXPECTED, num_expected_blobs as f64);
debug!(num_expected_blobs, "Fetching blobs from the EL");
// Track request count and duration for standardized metrics
inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL);
let _timer =
metrics::start_timer(&metrics::BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS);
let response = chain_adapter
.get_blobs_v2(versioned_hashes)
.await
@@ -254,6 +260,11 @@ async fn fetch_and_process_blobs_v2<T: BeaconChainTypes>(
inc_counter(&metrics::BLOBS_FROM_EL_ERROR_TOTAL);
})?;
drop(_timer);
// Track successful response
inc_counter(&metrics::BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL);
let Some(blobs_and_proofs) = response else {
debug!(num_expected_blobs, "No blobs fetched from the EL");
inc_counter(&metrics::BLOBS_FROM_EL_MISS_TOTAL);