Documentation
¶
Index ¶
- Constants
- func Execute()
- type AlertActive
- type AlertConfig
- type AlertLevel
- type AlertType
- type BlockFetchError
- type ChainHaltError
- type DiscordChannelConfig
- type DiscordNotificationService
- type DiscordWebhookConfig
- type GenericRPCError
- type IgnorableError
- type JailedError
- type MissedRecentBlocksError
- type NodecordConfig
- type NotificationService
- type NotificationsConfig
- type OutOfSyncError
- type Sentry
- type SentryAlertType
- type SentryGRPCError
- type SentryHaltError
- type SentryOutOfSyncError
- type SentryStats
- type TombstonedError
- type ValidatorAlertNotification
- type ValidatorAlertState
- type ValidatorMonitor
- type ValidatorStats
Constants ¶
View Source
const (
RPCTimeoutSeconds = 5
)
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlertActive ¶
type AlertActive interface {
Active(config AlertConfig) bool
}
type AlertConfig ¶
type AlertConfig struct {
IgnoreAlerts []*AlertType `yaml:"ignore-alerts"`
}
func (*AlertConfig) AlertActive ¶
func (at *AlertConfig) AlertActive(alert AlertType) bool
type AlertLevel ¶
type AlertLevel int8
type BlockFetchError ¶
type BlockFetchError struct {
// contains filtered or unexported fields
}
func (*BlockFetchError) Active ¶
func (e *BlockFetchError) Active(config AlertConfig) bool
func (*BlockFetchError) Error ¶
func (e *BlockFetchError) Error() string
type ChainHaltError ¶
type ChainHaltError struct {
// contains filtered or unexported fields
}
func (*ChainHaltError) Active ¶
func (e *ChainHaltError) Active(config AlertConfig) bool
func (*ChainHaltError) Error ¶
func (e *ChainHaltError) Error() string
type DiscordChannelConfig ¶
type DiscordChannelConfig struct {
Webhook DiscordWebhookConfig `yaml:"webhook"`
AlertUserIDs []string `yaml:"alert-user-ids"`
Username string `yaml:"username"`
}
type DiscordNotificationService ¶
type DiscordNotificationService struct {
// contains filtered or unexported fields
}
func NewDiscordNotificationService ¶
func NewDiscordNotificationService(webhookID, webhookToken string) *DiscordNotificationService
func (*DiscordNotificationService) SendValidatorAlertNotification ¶
func (service *DiscordNotificationService) SendValidatorAlertNotification( config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, alertNotification *ValidatorAlertNotification, )
implements NotificationService interface
func (*DiscordNotificationService) UpdateValidatorRealtimeStatus ¶
func (service *DiscordNotificationService) UpdateValidatorRealtimeStatus( configFile string, config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, writeConfigMutex *sync.Mutex, )
implements NotificationService interface
type DiscordWebhookConfig ¶
type GenericRPCError ¶
type GenericRPCError struct {
// contains filtered or unexported fields
}
func (*GenericRPCError) Active ¶
func (e *GenericRPCError) Active(config AlertConfig) bool
func (*GenericRPCError) Error ¶
func (e *GenericRPCError) Error() string
type IgnorableError ¶
type IgnorableError interface {
error
AlertActive
}
type JailedError ¶
type JailedError struct {
// contains filtered or unexported fields
}
func (*JailedError) Active ¶
func (e *JailedError) Active(config AlertConfig) bool
func (*JailedError) Error ¶
func (e *JailedError) Error() string
type MissedRecentBlocksError ¶
type MissedRecentBlocksError struct {
// contains filtered or unexported fields
}
func (*MissedRecentBlocksError) Active ¶
func (e *MissedRecentBlocksError) Active(config AlertConfig) bool
func (*MissedRecentBlocksError) Error ¶
func (e *MissedRecentBlocksError) Error() string
type NodecordConfig ¶
type NodecordConfig struct {
AlertConfig AlertConfig `yaml:"alerts"`
Notifications *NotificationsConfig `yaml:"notifications"`
Validators []*ValidatorMonitor `yaml:"validators"`
}
type NotificationService ¶
type NotificationService interface {
// send one time alert for validator
SendValidatorAlertNotification(config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, alertNotification *ValidatorAlertNotification)
// update (or create) realtime status for validator
UpdateValidatorRealtimeStatus(configFile string, config *NodecordConfig, vm *ValidatorMonitor, stats ValidatorStats, writeConfigMutex *sync.Mutex)
}
type NotificationsConfig ¶
type NotificationsConfig struct {
Service string `yaml:"service"`
Discord *DiscordChannelConfig `yaml:"discord"`
}
type OutOfSyncError ¶
type OutOfSyncError struct {
// contains filtered or unexported fields
}
func (*OutOfSyncError) Active ¶
func (e *OutOfSyncError) Active(config AlertConfig) bool
func (*OutOfSyncError) Error ¶
func (e *OutOfSyncError) Error() string
type SentryAlertType ¶
type SentryAlertType int8
type SentryGRPCError ¶
type SentryGRPCError struct {
// contains filtered or unexported fields
}
func (*SentryGRPCError) Error ¶
func (e *SentryGRPCError) Error() string
type SentryHaltError ¶
type SentryHaltError struct {
// contains filtered or unexported fields
}
func (*SentryHaltError) Error ¶
func (e *SentryHaltError) Error() string
type SentryOutOfSyncError ¶
type SentryOutOfSyncError struct {
// contains filtered or unexported fields
}
func (*SentryOutOfSyncError) Error ¶
func (e *SentryOutOfSyncError) Error() string
type SentryStats ¶
type SentryStats struct {
Name string
Version string
Height int64
SentryAlertType SentryAlertType
}
type TombstonedError ¶
type TombstonedError struct{}
func (*TombstonedError) Active ¶
func (e *TombstonedError) Active(config AlertConfig) bool
func (*TombstonedError) Error ¶
func (e *TombstonedError) Error() string
type ValidatorAlertNotification ¶
type ValidatorAlertNotification struct {
Alerts []string
ClearedAlerts []string
NotifyForClear bool
AlertLevel AlertLevel
}
type ValidatorAlertState ¶
type ValidatorAlertState struct {
AlertTypeCounts map[AlertType]int64
SentryGRPCErrorCounts map[string]int64
SentryOutOfSyncErrorCounts map[string]int64
SentryHaltErrorCounts map[string]int64
SentryLatestHeight map[string]int64
RecentMissedBlocksCounter int64
RecentMissedBlocksCounterMax int64
LatestBlockChecked int64
LatestBlockSigned int64
}
type ValidatorMonitor ¶
type ValidatorStats ¶
type ValidatorStats struct {
Timestamp time.Time
Height int64
RecentMissedBlocks int64
LastSignedBlockHeight int64
RecentMissedBlockAlertLevel AlertLevel
LastSignedBlockTimestamp time.Time
SlashingPeriodUptime float64
SentryStats []*SentryStats
AlertLevel AlertLevel
RPCError bool
}
Click to show internal directories.
Click to hide internal directories.