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);

View File

@@ -1689,6 +1689,33 @@ pub static BLOBS_FROM_EL_RECEIVED: LazyLock<Result<Histogram>> = LazyLock::new(|
)
});
/*
* Standardized getBlobs metrics across clients from https://github.com/ethereum/beacon-metrics
*/
pub static BEACON_ENGINE_GET_BLOBS_V2_REQUESTS_TOTAL: LazyLock<Result<IntCounter>> =
LazyLock::new(|| {
try_create_int_counter(
"beacon_engine_getBlobsV2_requests_total",
"Total number of engine_getBlobsV2 requests made to the execution layer",
)
});
pub static BEACON_ENGINE_GET_BLOBS_V2_RESPONSES_TOTAL: LazyLock<Result<IntCounter>> =
LazyLock::new(|| {
try_create_int_counter(
"beacon_engine_getBlobsV2_responses_total",
"Total number of successful engine_getBlobsV2 responses from the execution layer",
)
});
pub static BEACON_ENGINE_GET_BLOBS_V2_REQUEST_DURATION_SECONDS: LazyLock<Result<Histogram>> =
LazyLock::new(|| {
try_create_histogram(
"beacon_engine_getBlobsV2_request_duration_seconds",
"Duration of engine_getBlobsV2 requests to the execution layer in seconds",
)
});
/*
* Light server message verification
*/