Skip to content

Add provider label to block_receipt_delay_seconds histogram - #391

Open
AntiD2ta wants to merge 1 commit into
masterfrom
add-block-receipt-delay-provider-label
Open

Add provider label to block_receipt_delay_seconds histogram#391
AntiD2ta wants to merge 1 commit into
masterfrom
add-block-receipt-delay-provider-label

Conversation

@AntiD2ta

@AntiD2ta AntiD2ta commented Mar 25, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Adds a provider label to the vouch_block_receipt_delay_seconds histogram, identifying which beacon node delivered the head event
  • The address is resolved at event time via a type assertion on the existing events provider to eth2client.Service, so it reflects the currently active client even after failovers

Test plan

  • go build ./... compiles cleanly
  • go test ./services/controller/standard/... — all 29 tests pass (including 2 new)
  • golangci-lint run — no new issues
  • Manual: run Vouch with Prometheus, query vouch_block_receipt_delay_seconds_bucket and confirm provider label appears

Add a `provider` label to the `vouch_block_receipt_delay_seconds`
histogram so operators can identify which beacon node delivered the
head event. The address is obtained at event time via a type assertion
on the events provider to eth2client.Service, which the multi-client
satisfies — ensuring the label reflects the currently active client
even after failovers.
@AntiD2ta AntiD2ta self-assigned this Mar 25, 2026
@AntiD2ta AntiD2ta added the feature New feature or request label Mar 25, 2026
@AntiD2ta
AntiD2ta requested a review from Bez625 March 25, 2026 09:57
monitorBlockDelay(uint(uint64(data.Slot)%s.slotsPerEpoch), time.Since(s.chainTimeService.StartOfSlot(data.Slot)))
var provider string
if svc, ok := s.eventsProvider.(eth2client.Service); ok {
provider = svc.Address()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I'm pretty convinced this will not work as expected. If you take a look here, the multi-client only returns the first active client in the array.

I think this might require work in go-eth2-client to pass back the provider in the head event data struct. This should tell us the actual provider that sent the event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants