Skip to content

Engine getblobs v2 metrics #31834

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

Open
wants to merge 58 commits into
base: peerdas-devnet-7
Choose a base branch
from

Conversation

SunnysidedJ
Copy link

Re-opening from MariusVanDerWijden#66

MariusVanDerWijden and others added 14 commits May 9, 2025 12:22
While running kurtosis and spamoor, I noticed occasional `null` entries
coming back from `getBlobsV2`. After investigating, I found that spamoor
can use the same blob data across multiple transactions, so with larger
blob counts, there's an increased chance that a blob is included in a
block more than once. As a result, previous indexes in the hash-to-index
map in `getBlobsV2` would get overwritten.

I changed the map from `map[common.Hash]int` to `map[common.Hash][]int`
to handle this case. I decided to go this route because it's the
smallest-possible fix, but it could also make sense to update
`blobpool.GetBlobs` to de-duplicate the hashes.
Comment on lines +166 to +172
getBlobsV2BlobsRequestedTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_total", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsV2BlobsInPoolTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_in_blobpool_total", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("get_blobs_requests_success_total", nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("get_blobs_requests_failure_total", nil)
Copy link
Member

@MariusVanDerWijden MariusVanDerWijden May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about something like this?

Suggested change
getBlobsV2BlobsRequestedTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_total", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsV2BlobsInPoolTotal = metrics.NewRegisteredCounter("get_blobs_requests_blobs_in_blobpool_total", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("get_blobs_requests_success_total", nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("get_blobs_requests_failure_total", nil)
getBlobsRequestedCounter = metrics.NewRegisteredCounter("engine/getblobs/requested", nil)
// Number of blobs requested via getBlobsV2 that are present in the blobpool
getBlobsAvailableCounter = metrics.NewRegisteredCounter("engine/getblobs/available", nil)
// Number of times getBlobsV2 responded with “hit”
getBlobsV2RequestHit = metrics.NewRegisteredCounter("engine/getblobs/hit, nil)
// Number of times getBlobsV2 responded with “miss”
getBlobsV2RequestMiss = metrics.NewRegisteredCounter("engine/getblobs/miss", nil)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This naming convention is also reasonable approach. Unfortunately, we are trying to follow the convention recommended by Prometheus, and some clients already have them merged. Would you mind these names? The documentation is here (mentioned in the original PR): https://testinprod.notion.site/Proposal-for-Unified-EL-metrics-for-PeerDAS-1d28fc57f54680f2a3cbfe408d7db4b8?pvs=4

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the prometheus exporter, we replace / by _. So our names are aligned with the Prometheus convention. We can discuss the names, but I feel that they should at least contain the engine prefix. We have a lot of metrics and they are all categorized nicely. Don't want to break this.


for i, hash := range hashes {
for i, hash := range hashes {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems wrong whitespacing imo, please go format -ed your files

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, it seems like I made typo while merging conflicts on the web.

@MariusVanDerWijden
Copy link
Member

Looks like they want to standardize metric names across clients. We should discuss on triage if we want that

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants