Skip to content

Commit

Permalink
Flush statsd metrics, add namespace (#36)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmcgary authored May 31, 2024
2 parents d062bd6 + 6922051 commit 88f6e72
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cmd/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ var updaterCmd = &cobra.Command{
if err != nil {
log.Fatalln(err)
}

s.Incr(metrics.Counter_UpdateRuns, nil, 1)

logger, err := logger.NewLogger(&logger.LoggerConfig{
Expand All @@ -99,6 +100,9 @@ var updaterCmd = &cobra.Command{
if err != nil {
logger.Sugar().Error(err)
}
if err := s.Close(); err != nil {
logger.Sugar().Error("Failed to close statsd client", zap.Error(err))
}
},
}

Expand Down
2 changes: 1 addition & 1 deletion internal/metrics/metrics.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ var statsdClient *statsd.Client

func InitStatsdClient(addr string) (*statsd.Client, error) {
var err error
statsdClient, err = statsd.New(addr)
statsdClient, err = statsd.New(addr, statsd.WithNamespace("eigenlayer_rewards_updater."))
return statsdClient, err
}

Expand Down

0 comments on commit 88f6e72

Please sign in to comment.