Skip to content

Commit

Permalink
Remove unused prometheus metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-ssvlabs committed Nov 15, 2024
1 parent c708849 commit 5cb528b
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 40 deletions.
31 changes: 0 additions & 31 deletions monitoring/metricsreporter/metrics_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ const (
executionClientSyncing = float64(1)
executionClientOK = float64(2)

validatorInactive = float64(0)
validatorNoIndex = float64(1)
validatorError = float64(2)
validatorReady = float64(3)
Expand Down Expand Up @@ -62,14 +61,6 @@ var (
Name: "ssv:validator:v2:status",
Help: "Validator status",
}, []string{"pubKey"})
eventProcessed = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "ssv_eth1_sync_count_success",
Help: "Count succeeded execution client events",
}, []string{"etype"})
eventProcessingFailed = promauto.NewCounterVec(prometheus.CounterOpts{
Name: "ssv_eth1_sync_count_failed",
Help: "Count failed execution client events",
}, []string{"etype"})
operatorIndex = promauto.NewGaugeVec(prometheus.GaugeOpts{
Name: "ssv:exporter:operator_index",
Help: "operator footprint",
Expand Down Expand Up @@ -170,7 +161,6 @@ type MetricsReporter interface {
ExecutionClientFailure()
ExecutionClientLastFetchedBlock(block uint64)
OperatorPublicKey(operatorID spectypes.OperatorID, publicKey []byte)
ValidatorInactive(publicKey []byte)
ValidatorNoIndex(publicKey []byte)
ValidatorError(publicKey []byte)
ValidatorReady(publicKey []byte)
Expand All @@ -181,13 +171,9 @@ type MetricsReporter interface {
ValidatorPending(publicKey []byte)
ValidatorRemoved(publicKey []byte)
ValidatorUnknown(publicKey []byte)
EventProcessed(eventName string)
EventProcessingFailed(eventName string)
MessagesReceivedFromPeer(peerId peer.ID)
MessagesReceivedTotal()
MessageValidationRSAVerifications()
LastBlockProcessed(block uint64)
LogsProcessingError(err error)
MessageAccepted(role spectypes.RunnerRole, round specqbft.Round)
MessageIgnored(reason string, role spectypes.RunnerRole, round specqbft.Round)
MessageRejected(reason string, role spectypes.RunnerRole, round specqbft.Round)
Expand Down Expand Up @@ -232,8 +218,6 @@ func New(opts ...Option) MetricsReporter {
executionClientStatus,
executionClientLastFetchedBlock,
validatorStatus,
eventProcessed,
eventProcessingFailed,
operatorIndex,
messageValidationResult,
messageValidationSSVType,
Expand Down Expand Up @@ -299,9 +283,6 @@ func (m *metricsReporter) OperatorPublicKey(operatorID spectypes.OperatorID, pub
operatorIndex.WithLabelValues(pkHash, strconv.FormatUint(operatorID, 10)).Set(float64(operatorID))
}

func (m *metricsReporter) ValidatorInactive(publicKey []byte) {
validatorStatus.WithLabelValues(ethcommon.Bytes2Hex(publicKey)).Set(validatorInactive)
}
func (m *metricsReporter) ValidatorNoIndex(publicKey []byte) {
validatorStatus.WithLabelValues(ethcommon.Bytes2Hex(publicKey)).Set(validatorNoIndex)
}
Expand Down Expand Up @@ -333,14 +314,6 @@ func (m *metricsReporter) ValidatorUnknown(publicKey []byte) {
validatorStatus.WithLabelValues(ethcommon.Bytes2Hex(publicKey)).Set(validatorUnknown)
}

func (m *metricsReporter) EventProcessed(eventName string) {
eventProcessed.WithLabelValues(eventName).Inc()
}

func (m *metricsReporter) EventProcessingFailed(eventName string) {
eventProcessingFailed.WithLabelValues(eventName).Inc()
}

func (m *metricsReporter) MessagesReceivedFromPeer(peerId peer.ID) {
messagesReceivedFromPeer.WithLabelValues(peerId.String()).Inc()
}
Expand All @@ -353,10 +326,6 @@ func (m *metricsReporter) MessageValidationRSAVerifications() {
messageValidationRSAVerifications.WithLabelValues().Inc()
}

// TODO implement
func (m *metricsReporter) LastBlockProcessed(uint64) {}
func (m *metricsReporter) LogsProcessingError(error) {}

func (m *metricsReporter) MessageAccepted(role spectypes.RunnerRole, round specqbft.Round) {
messageValidationResult.WithLabelValues(
messageAccepted,
Expand Down
5 changes: 0 additions & 5 deletions monitoring/metricsreporter/nop_metrics_reporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ func (n *nopMetrics) ExecutionClientSyncing()
func (n *nopMetrics) ExecutionClientFailure() {}
func (n *nopMetrics) ExecutionClientLastFetchedBlock(block uint64) {}
func (n *nopMetrics) OperatorPublicKey(operatorID spectypes.OperatorID, publicKey []byte) {}
func (n *nopMetrics) ValidatorInactive(publicKey []byte) {}
func (n *nopMetrics) ValidatorNoIndex(publicKey []byte) {}
func (n *nopMetrics) ValidatorError(publicKey []byte) {}
func (n *nopMetrics) ValidatorReady(publicKey []byte) {}
Expand All @@ -34,13 +33,9 @@ func (n *nopMetrics) ValidatorNotFound(publicKey []byte)
func (n *nopMetrics) ValidatorPending(publicKey []byte) {}
func (n *nopMetrics) ValidatorRemoved(publicKey []byte) {}
func (n *nopMetrics) ValidatorUnknown(publicKey []byte) {}
func (n *nopMetrics) EventProcessed(eventName string) {}
func (n *nopMetrics) EventProcessingFailed(eventName string) {}
func (n *nopMetrics) MessagesReceivedFromPeer(peerId peer.ID) {}
func (n *nopMetrics) MessagesReceivedTotal() {}
func (n *nopMetrics) MessageValidationRSAVerifications() {}
func (n *nopMetrics) LastBlockProcessed(block uint64) {}
func (n *nopMetrics) LogsProcessingError(err error) {}
func (n *nopMetrics) GenesisMessageAccepted(role genesisspectypes.BeaconRole, round genesisspecqbft.Round) {
}
func (n *nopMetrics) GenesisMessageIgnored(reason string, role genesisspectypes.BeaconRole, round genesisspecqbft.Round) {
Expand Down
2 changes: 0 additions & 2 deletions protocol/genesis/ssv/validator/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

type Metrics interface {
ValidatorInactive(publicKey []byte)
ValidatorNoIndex(publicKey []byte)
ValidatorError(publicKey []byte)
ValidatorReady(publicKey []byte)
Expand All @@ -26,7 +25,6 @@ type Metrics interface {

type NopMetrics struct{}

func (n NopMetrics) ValidatorInactive([]byte) {}
func (n NopMetrics) ValidatorNoIndex([]byte) {}
func (n NopMetrics) ValidatorError([]byte) {}
func (n NopMetrics) ValidatorReady([]byte) {}
Expand Down
2 changes: 0 additions & 2 deletions protocol/v2/ssv/validator/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
)

type Metrics interface {
ValidatorInactive(publicKey []byte)
ValidatorNoIndex(publicKey []byte)
ValidatorError(publicKey []byte)
ValidatorReady(publicKey []byte)
Expand All @@ -26,7 +25,6 @@ type Metrics interface {

type NopMetrics struct{}

func (n NopMetrics) ValidatorInactive([]byte) {}
func (n NopMetrics) ValidatorNoIndex([]byte) {}
func (n NopMetrics) ValidatorError([]byte) {}
func (n NopMetrics) ValidatorReady([]byte) {}
Expand Down

0 comments on commit 5cb528b

Please sign in to comment.