-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Earliest Available Slot metrics #16069
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
base: develop
Are you sure you want to change the base?
Changes from 6 commits
8167e2a
170bbc1
730f31d
3776470
72c75bc
d4f5dc9
2cfce72
e5ab849
b4dadc3
af736f6
c0c825d
391c20f
bb8374a
ce55a55
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| load("@prysm//tools/go:def.bzl", "go_library") | ||
|
|
||
| go_library( | ||
| name = "go_default_library", | ||
| srcs = ["metrics.go"], | ||
| importpath = "github.com/OffchainLabs/prysm/v7/beacon-chain/custody", | ||
| visibility = ["//visibility:public"], | ||
| deps = [ | ||
| "//consensus-types/primitives:go_default_library", | ||
| "@com_github_prometheus_client_golang//prometheus:go_default_library", | ||
| "@com_github_prometheus_client_golang//prometheus/promauto:go_default_library", | ||
| ], | ||
| ) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| // Package custody provides common custody-related metrics | ||
| package custody | ||
|
|
||
| import ( | ||
| "github.com/OffchainLabs/prysm/v7/consensus-types/primitives" | ||
| "github.com/prometheus/client_golang/prometheus" | ||
| "github.com/prometheus/client_golang/prometheus/promauto" | ||
| ) | ||
|
|
||
| var ( | ||
| // 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", | ||
|
||
| }) | ||
|
|
||
| // 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", | ||
|
||
| }) | ||
| ) | ||
|
|
||
| // UpdateP2PMetric updates the P2P earliest available slot metric | ||
| func UpdateP2PMetric(slot primitives.Slot) { | ||
| EarliestAvailableSlotP2P.Set(float64(slot)) | ||
| } | ||
|
|
||
| // UpdateDBMetric updates the DB earliest available slot metric | ||
| func UpdateDBMetric(slot primitives.Slot) { | ||
| EarliestAvailableSlotDB.Set(float64(slot)) | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| ### Added | ||
|
|
||
| - Metric for earliest available slot. |
There was a problem hiding this comment.
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.