Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CorrelationKey ¶
Types ¶
type Correlator ¶
type Correlator struct {
// contains filtered or unexported fields
}
func NewCorrelator ¶
func NewCorrelator(updateInterval time.Duration) *Correlator
func (*Correlator) Ingest ¶
func (c *Correlator) Ingest(event Event) IngestResult
func (*Correlator) List ¶
func (c *Correlator) List() []Incident
func (*Correlator) Restore ¶
func (c *Correlator) Restore(incidents []Incident)
type Event ¶
type Event struct {
ID string `json:"id"`
Source string `json:"source"`
Type string `json:"type"`
Severity Severity `json:"severity"`
Title string `json:"title"`
Message string `json:"message"`
Scope Scope `json:"scope"`
CorrelationKey string `json:"correlation_key,omitempty"`
OccurredAt time.Time `json:"occurred_at"`
Attributes map[string]any `json:"attributes,omitempty"`
Resolved bool `json:"resolved,omitempty"`
}
type Incident ¶
type Incident struct {
ID string `json:"id"`
CorrelationKey string `json:"correlation_key"`
Status IncidentStatus `json:"status"`
Severity Severity `json:"severity"`
Title string `json:"title"`
EventCount int `json:"event_count"`
FirstEventAt time.Time `json:"first_event_at"`
LastEventAt time.Time `json:"last_event_at"`
LastEvent Event `json:"last_event"`
}
type IncidentStatus ¶
type IncidentStatus string
const ( IncidentOpen IncidentStatus = "open" IncidentResolved IncidentStatus = "resolved" )
type IngestResult ¶
type IngestResult struct {
Incident Incident `json:"incident"`
Notification NotificationAction `json:"notification"`
}
type NotificationAction ¶
type NotificationAction string
const ( NotificationNone NotificationAction = "none" NotificationOpened NotificationAction = "opened" NotificationUpdated NotificationAction = "updated" NotificationResolved NotificationAction = "resolved" )
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ListIncidents ¶
Click to show internal directories.
Click to hide internal directories.