File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -116,6 +116,9 @@ chains:
116116 # Should an alert be sent if no RPC servers are responding? (Note this alarm is instantaneous with no delay)
117117 alert_if_no_servers : yes
118118
119+ # Should alerts be sent there are open governance proposals?
120+ governance_alerts : yes
121+
119122 # for this *specific* chain it's possible to override alert settings. If the api_key or webhook addresses are empty,
120123 # the global settings will be used. Note, enabled must be set both globally and for each chain.
121124
Original file line number Diff line number Diff line change @@ -685,18 +685,21 @@ func (cc *ChainConfig) watch() {
685685 unvotedProposalMap [id ] = true
686686 }
687687
688- for _ , proposalID := range cc .unvotedOpenGovProposalIds {
689- id := fmt .Sprintf (idTemplate , cc .valInfo .Valcons , proposalID )
690- alertMsg := fmt .Sprintf (msgTemplate , proposalID )
688+ // Only send governance alerts if they're enabled
689+ if cc .Alerts .GovernanceAlerts {
690+ for _ , proposalID := range cc .unvotedOpenGovProposalIds {
691+ id := fmt .Sprintf (idTemplate , cc .valInfo .Valcons , proposalID )
692+ alertMsg := fmt .Sprintf (msgTemplate , proposalID )
691693
692- // Send alert for this specific proposal
693- td .alert (
694- cc .name ,
695- alertMsg ,
696- "warning" ,
697- false ,
698- & id ,
699- )
694+ // Send alert for this specific proposal
695+ td .alert (
696+ cc .name ,
697+ alertMsg ,
698+ "warning" ,
699+ false ,
700+ & id ,
701+ )
702+ }
700703 }
701704
702705 // check and resolve the alert if the proposal has been voted on
Original file line number Diff line number Diff line change @@ -189,6 +189,9 @@ type AlertConfig struct {
189189 // AlertIfNoServers: should an alert be sent if no servers are reachable?
190190 AlertIfNoServers bool `yaml:"alert_if_no_servers"`
191191
192+ // Whether to alert on unvoted governance proposals
193+ GovernanceAlerts bool `yaml:"governance_alerts"`
194+
192195 // PagerdutyAlerts: Should pagerduty alerts be sent for this chain? Both 'config.pagerduty.enabled: yes' and this must be set.
193196 // Deprecated: use Pagerduty.Enabled instead
194197 PagerdutyAlerts bool `yaml:"pagerduty_alerts"`
Original file line number Diff line number Diff line change @@ -127,6 +127,7 @@ func (cc *ChainConfig) GetValInfo(first bool) (err error) {
127127 }
128128 }
129129
130+ // Query for unvoted proposals regardless of alert setting
130131 unvotedProposalIds , err := provider .QueryUnvotedOpenProposalIds (ctx )
131132 if err == nil {
132133 cc .unvotedOpenGovProposalIds = unvotedProposalIds
@@ -137,6 +138,11 @@ func (cc *ChainConfig) GetValInfo(first bool) (err error) {
137138 l (err )
138139 }
139140
141+ // Log if governance alerts are disabled (only on first run)
142+ if first && ! cc .Alerts .GovernanceAlerts {
143+ l (fmt .Sprintf ("ℹ️ Governance alerts disabled for %s (%s)" , cc .ValAddress , cc .valInfo .Moniker ))
144+ }
145+
140146 signingInfo , err := provider .QuerySigningInfo (ctx )
141147 if err != nil {
142148 return
You can’t perform that action at this time.
0 commit comments