mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2024-12-25 12:57:18 +00:00
a2c1185032
* Add sync committeee contributions to monitor * gaz * Raul's review * Added lock around TrackedValidators * add comment to trackedIndex * add missing locks because of trackedIndex * Terence fixes 2 * moved TrackedValidator to service from config * Terence comment fix Co-authored-by: Raul Jordan <raul@prysmaticlabs.com>
94 lines
2.4 KiB
Go
94 lines
2.4 KiB
Go
package monitor
|
|
|
|
import (
|
|
"github.com/prometheus/client_golang/prometheus"
|
|
"github.com/prometheus/client_golang/prometheus/promauto"
|
|
"github.com/sirupsen/logrus"
|
|
)
|
|
|
|
var (
|
|
log = logrus.WithField("prefix", "monitor")
|
|
// TODO: The Prometheus gauge vectors and counters in this package deprecate the
|
|
// corresponding gauge vectors and counters in the validator client.
|
|
|
|
// inclusionSlotGauge used to track attestation inclusion distance
|
|
inclusionSlotGauge = promauto.NewGaugeVec(
|
|
prometheus.GaugeOpts{
|
|
Namespace: "monitor",
|
|
Name: "inclusion_slot",
|
|
Help: "Attestations inclusion slot",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
// timelyHeadCounter used to track attestation timely head flags
|
|
timelyHeadCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "timely_head",
|
|
Help: "Attestation timely Head flag",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
// timelyTargetCounter used to track attestation timely head flags
|
|
timelyTargetCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "timely_target",
|
|
Help: "Attestation timely Target flag",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
// timelySourceCounter used to track attestation timely head flags
|
|
timelySourceCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "timely_source",
|
|
Help: "Attestation timely Source flag",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
|
|
// proposedSlotsCounter used to track proposed blocks
|
|
proposedSlotsCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "proposed_slots_total",
|
|
Help: "Number of proposed blocks included",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
// aggregationCounter used to track aggregations
|
|
aggregationCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "aggregations",
|
|
Help: "Number of aggregation duties performed",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
// syncCommitteeContributionCounter used to track sync committee
|
|
// contributions
|
|
syncCommitteeContributionCounter = promauto.NewCounterVec(
|
|
prometheus.CounterOpts{
|
|
Namespace: "monitor",
|
|
Name: "sync_committee_contributions_total",
|
|
Help: "Number of Sync committee contributions performed",
|
|
},
|
|
[]string{
|
|
"validator_index",
|
|
},
|
|
)
|
|
)
|