Skip to content

Conversation

@satushh
Copy link
Collaborator

@satushh satushh commented Nov 27, 2025

What type of PR is this?

Feature

What does this PR do? Why is it needed?

This PR adds metrics for earliest available slot. Two metrics are added corresponding to the DB update and p2p update. They have been tested on kurtosis to exactly match.

Which issues(s) does this PR fix?

Fixes #

Other notes for review

Acknowledgements

@satushh satushh marked this pull request as ready for review November 27, 2025 18:28
@satushh satushh changed the title Eas metric 2 Earliest Available Slot metrics Nov 27, 2025
var (
// EarliestAvailableSlotP2P tracks the earliest available slot in the p2p service
EarliestAvailableSlotP2P = promauto.NewGauge(prometheus.GaugeOpts{
Name: "custody_earliest_available_slot_p2p",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just earlied_available_slot_p2p?

// EarliestAvailableSlotP2P tracks the earliest available slot in the p2p service
EarliestAvailableSlotP2P = promauto.NewGauge(prometheus.GaugeOpts{
Name: "custody_earliest_available_slot_p2p",
Help: "The earliest available slot tracked by the p2p service for custody purposes",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why for custody purposes?


// EarliestAvailableSlotDB tracks the earliest available slot in the database
EarliestAvailableSlotDB = promauto.NewGauge(prometheus.GaugeOpts{
Name: "custody_earliest_available_slot_db",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just earliest_available_slot_db?

// EarliestAvailableSlotDB tracks the earliest available slot in the database
EarliestAvailableSlotDB = promauto.NewGauge(prometheus.GaugeOpts{
Name: "custody_earliest_available_slot_db",
Help: "The earliest available slot tracked by the database for custody purposes",
Copy link
Contributor

Choose a reason for hiding this comment

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

Why for custody purposes?

@@ -0,0 +1,32 @@
// Package custody provides common custody-related metrics
package custody
Copy link
Contributor

Choose a reason for hiding this comment

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

Please do not create a whole package only to add 2 metrics.

Copy link
Contributor

@nalepae nalepae left a comment

Choose a reason for hiding this comment

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

I did not read all the PR.

My main question is:
Why not simply update the metrics in the function actually changing the corresponding values, or when the correspond values are first pulled at the start of the node?

You can start by identifying all places where the eas is updated, then the place where eas if first pulled from the DB.
Then, just add metrics update in those places.

@satushh satushh requested a review from nalepae December 2, 2025 13:00
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.

3 participants