Skip to content

Commit

Permalink
Observability - remove old metric implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
oleg-ssvlabs committed Dec 3, 2024
1 parent d3927b9 commit a946027
Show file tree
Hide file tree
Showing 5 changed files with 2 additions and 240 deletions.
11 changes: 2 additions & 9 deletions cli/operator/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,6 @@ import (
genesisvalidation "github.com/ssvlabs/ssv/message/validation/genesis"
"github.com/ssvlabs/ssv/migrations"
"github.com/ssvlabs/ssv/monitoring/metrics"
"github.com/ssvlabs/ssv/monitoring/metricsreporter"
"github.com/ssvlabs/ssv/network"
p2pv1 "github.com/ssvlabs/ssv/network/p2p"
"github.com/ssvlabs/ssv/networkconfig"
Expand Down Expand Up @@ -115,10 +114,6 @@ var StartNodeCmd = &cobra.Command{

logger.Info(fmt.Sprintf("starting %v", commons.GetBuildData()))

metricsReporter := metricsreporter.New(
metricsreporter.WithLogger(logger),
)

observabilityShutdown, err := observability.Initialize(
cmd.Parent().Short,
cmd.Parent().Version,
Expand Down Expand Up @@ -268,7 +263,7 @@ var StartNodeCmd = &cobra.Command{
cfg.P2pNetworkConfig.MessageValidator = messageValidator
cfg.SSVOptions.ValidatorOptions.MessageValidator = messageValidator

p2pNetwork, genesisP2pNetwork := setupP2P(logger, db, metricsReporter)
p2pNetwork, genesisP2pNetwork := setupP2P(logger, db)

cfg.SSVOptions.Context = cmd.Context()
cfg.SSVOptions.DB = db
Expand Down Expand Up @@ -378,7 +373,6 @@ var StartNodeCmd = &cobra.Command{
logger,
executionClient,
validatorCtrl,
metricsReporter,
networkConfig,
nodeStorage,
operatorDataStore,
Expand Down Expand Up @@ -655,7 +649,7 @@ func setupSSVNetwork(logger *zap.Logger) (networkconfig.NetworkConfig, error) {
return networkConfig, nil
}

func setupP2P(logger *zap.Logger, db basedb.Database, mr metricsreporter.MetricsReporter) (network.P2PNetwork, p2pv1.GenesisP2P) {
func setupP2P(logger *zap.Logger, db basedb.Database) (network.P2PNetwork, p2pv1.GenesisP2P) {
istore := ssv_identity.NewIdentityStore(db)
netPrivKey, err := istore.SetupNetworkKey(logger, cfg.NetworkPrivateKey)
if err != nil {
Expand Down Expand Up @@ -689,7 +683,6 @@ func setupEventHandling(
logger *zap.Logger,
executionClient *executionclient.ExecutionClient,
validatorCtrl validator.Controller,
metricsReporter metricsreporter.MetricsReporter,
networkConfig networkconfig.NetworkConfig,
nodeStorage operatorstorage.Storage,
operatorDataStore operatordatastore.OperatorDataStore,
Expand Down
11 changes: 0 additions & 11 deletions message/validation/genesis/validation.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import (
"github.com/ssvlabs/ssv/utils/hashmap"

"github.com/ssvlabs/ssv/logging/fields"
"github.com/ssvlabs/ssv/monitoring/metricsreporter"
"github.com/ssvlabs/ssv/network/commons"
"github.com/ssvlabs/ssv/networkconfig"
"github.com/ssvlabs/ssv/operator/duties/dutystore"
Expand Down Expand Up @@ -63,7 +62,6 @@ type MessageValidator interface {

type messageValidator struct {
logger *zap.Logger
metrics metricsreporter.MetricsReporter
netCfg networkconfig.NetworkConfig
index sync.Map
nodeStorage operatorstorage.Storage
Expand All @@ -83,7 +81,6 @@ type messageValidator struct {
func New(netCfg networkconfig.NetworkConfig, opts ...Option) MessageValidator {
mv := &messageValidator{
logger: zap.NewNop(),
metrics: metricsreporter.NewNop(),
netCfg: netCfg,
operatorIDToPubkeyCache: hashmap.New[spectypes.OperatorID, keys.OperatorPublicKey](),
validationLocks: make(map[spectypes.MessageID]*sync.Mutex),
Expand All @@ -106,13 +103,6 @@ func WithLogger(logger *zap.Logger) Option {
}
}

// WithMetrics sets the metrics for the messageValidator.
func WithMetrics(metrics metricsreporter.MetricsReporter) Option {
return func(mv *messageValidator) {
mv.metrics = metrics
}
}

// WithDutyStore sets the duty store for the messageValidator.
func WithDutyStore(dutyStore *dutystore.Store) Option {
return func(mv *messageValidator) {
Expand Down Expand Up @@ -292,7 +282,6 @@ func (mv *messageValidator) validateP2PMessage(pMsg *pubsub.Message, receivedAt
}

signatureVerifier := func() error {
mv.metrics.MessageValidationRSAVerifications()
return mv.verifySignature(signedSSVMsg)
}

Expand Down
168 changes: 0 additions & 168 deletions monitoring/metricsreporter/metrics_reporter.go

This file was deleted.

37 changes: 0 additions & 37 deletions monitoring/metricsreporter/nop_metrics_reporter.go

This file was deleted.

15 changes: 0 additions & 15 deletions monitoring/metricsreporter/options.go

This file was deleted.

0 comments on commit a946027

Please sign in to comment.