Documentation ¶
Index ¶
- Constants
- Variables
- type Alert
- type AlertTransformer
- type Filter
- type LogService
- type Repository
- type Service
- func (s *Service) CreateAlerts(ctx context.Context, providerType string, providerID uint64, ...) ([]Alert, int, error)
- func (s *Service) List(ctx context.Context, flt Filter) ([]Alert, error)
- func (s *Service) UpdateSilenceStatus(ctx context.Context, alertIDs []int64, hasSilenced bool, hasNonSilenced bool) error
Constants ¶
View Source
const ( SilenceStatusTotal = "total" SilenceStatusPartial = "partial" )
Variables ¶
View Source
var (
ErrRelation = errors.New("provider id does not exist")
)
Functions ¶
This section is empty.
Types ¶
type Alert ¶
type Alert struct { ID uint64 `json:"id"` ProviderID uint64 `json:"provider_id"` NamespaceID uint64 `json:"namespace_id"` ResourceName string `json:"resource_name"` MetricName string `json:"metric_name"` MetricValue string `json:"metric_value"` Severity string `json:"severity"` Rule string `json:"rule"` TriggeredAt time.Time `json:"triggered_at"` CreatedAt time.Time `json:"created_at"` UpdatedAt time.Time `json:"updated_at"` SilenceStatus string `json:"silence_status"` // These fields won't be stored in the DB // these are additional information for notification purposes GroupKey string Status string Annotations map[string]string Labels map[string]string GeneratorURL string Fingerprint string }
type AlertTransformer ¶ added in v0.5.0
type LogService ¶ added in v0.5.8
type Repository ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles business logic
func NewService ¶
func NewService(repository Repository, logService LogService, registry map[string]AlertTransformer) *Service
NewService returns repository struct
func (*Service) CreateAlerts ¶ added in v0.5.0
Source Files ¶
Click to show internal directories.
Click to hide internal directories.