Skip to content

Commit

Permalink
Merge pull request #6 from ethpandaops/refactor/analysis
Browse files Browse the repository at this point in the history
refactor: Improve analyzer logic and data structures
  • Loading branch information
mattevans authored Feb 8, 2025
2 parents d77815c + bf88a86 commit 3a069e4
Show file tree
Hide file tree
Showing 4 changed files with 511 additions and 283 deletions.
4 changes: 3 additions & 1 deletion cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ type Config struct {
OpenRouterKey string
GrafanaBaseURL string
PromDatasourceID string
AlertUnexplained bool
}

func main() {
Expand Down Expand Up @@ -85,6 +86,7 @@ func main() {
rootCmd.Flags().StringVar(&cfg.ExecutionNode, "ethereum-el", checks.ClientTypeAll.String(), "execution client to monitor")
rootCmd.Flags().StringVar(&cfg.GrafanaBaseURL, "grafana-base-url", defaultGrafanaBaseURL, "grafana base URL")
rootCmd.Flags().StringVar(&cfg.PromDatasourceID, "prometheus-datasource-id", defaultPromDatasourceID, "prometheus datasource ID")
rootCmd.Flags().BoolVar(&cfg.AlertUnexplained, "alert-unexplained", false, "whether to alert on unexplained issues")

if err := rootCmd.MarkFlagRequired("network"); err != nil {
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
Expand Down Expand Up @@ -152,7 +154,7 @@ func runChecks(cmd *cobra.Command, cfg Config) error {
}

// Send results to Discord.
if err := discordNotifier.SendResults(cfg.DiscordChannel, cfg.Network, targetClient, results, analysis); err != nil {
if err := discordNotifier.SendResults(cfg.DiscordChannel, cfg.Network, targetClient, results, analysis, cfg.AlertUnexplained); err != nil {
return fmt.Errorf("failed to send discord notification: %w", err)
}

Expand Down
Loading

0 comments on commit 3a069e4

Please sign in to comment.