Skip to content

Commit

Permalink
feat: Update metrics push logic
Browse files Browse the repository at this point in the history
  • Loading branch information
AntiD2ta committed Oct 4, 2024
1 parent 51d0dae commit 7b35467
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cli/eigen-minter.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ func run(cmd *cobra.Command, args []string) error {
if pushGatewayURL != "" {
m = metrics.NewMetrics(pushGatewayURL)
m.RecordTrigger()
slog.Debug(fmt.Sprintf("Pushing metrics to %s", pushGatewayURL))
if err := m.Push(); err != nil {
slog.Error(fmt.Sprintf("Failed to push metrics: %v\n", err))
}
}

cfg, err := validateConfig()
Expand Down Expand Up @@ -132,7 +136,10 @@ func run(cmd *cobra.Command, args []string) error {
if canPress {
slog.Info("Pressing button")
if err := pressButton(cfg, chainIDs[cfg.Network], rpcClient, c); err != nil {
return fmt.Errorf("failed to press button: %v", err)
slog.Error(fmt.Sprintf("failed to press button: %v", err))
if m != nil {
m.RecordPressButtonFailure()
}
} else {
slog.Info("Button pressed successfully")
if m != nil {
Expand Down

0 comments on commit 7b35467

Please sign in to comment.