Documentation ¶
Index ¶
Constants ¶
const ( // IncidentStatusOK means "This status is fully operational." IncidentStatusOK = 1 // IncidentStatusUnstable means "You received reports of a problem." IncidentStatusUnstable = 2 // IncidentStatusOutage means "A severe problem happened" IncidentStatusOutage = 3 )
const ( // WebhookIncomingType identify webhook incoming type WebhookIncomingType = "incoming" // WebhookOutgoingType identify webhook outgoing type WebhookOutgoingType = "outgoing" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { Ref string `json:"ref,omitempty"` Name string `json:"name" binding:"required"` Resources []string `json:"resource_refs"` }
Client is a structure that identify a group of resources by a name
type Component ¶
type Component struct { Ref string `json:"ref,omitempty"` Name string `json:"name" binding:"required"` Labels []string `json:"labels,omitempty"` Address string `json:"address"` }
Component represents a server, database, application or any resource that will be monitored
type ComponentLabels ¶
type ComponentLabels struct {
Labels []string `json:"labels,omitempty" binding:"required"`
}
ComponentLabels is a convenience structure that identifies an list of Component by labels
type ComponentRefs ¶
type ComponentRefs struct {
Refs []string `json:"refs,omitempty"`
}
ComponentRefs is a convenience structure that identifies an list of Component references
type Incident ¶
type Incident struct { Status int `json:"status" binding:"required"` Resolved bool `json:"resolved"` Description string `json:"description,omitempty"` Date time.Time `json:"occurrence_date" binding:"required"` Duration time.Duration `json:"duration"` ComponentRef string `json:"component_ref" bson:"component_ref" binding:"required"` }
Incident represents some event categorized by one of three possible status
type ListIncidentQueryParameters ¶
ListIncidentQueryParameters is a convenience structure that bags the query parameters of ListIncidentEndpoint
type PrometheusAlerts ¶
type PrometheusAlerts struct { Status string `json:"status"` PrometheusLabel PrometheusLabel `json:"labels,omitempty" binding:"required"` Component Component `json:"annotations,omitempty" binding:"required"` StartsAt time.Time `json:"startsAt,omitempty"` EndsAt time.Time `json:"endsAt"` GeneratorURL string `json:"generatorURL,omitempty"` }
PrometheusAlerts represents a special structure of Alert generated by Prometheus rules
type PrometheusIncomingWebhook ¶
type PrometheusIncomingWebhook struct {
Alerts []PrometheusAlerts `json:"alerts" binding:"required"`
}
PrometheusIncomingWebhook is the payload sent from the Prometheus AlertManager
type PrometheusLabel ¶
type PrometheusLabel struct { Status string `json:"status" binding:"required"` Description string `json:"description"` Date time.Time `json:"occurrence_date" binding:"required"` ComponentRef string `json:"component_ref" binding:"required"` }
PrometheusLabel is a structure created to be carried in the PrometheusAlerts with the Incident information
type Webhook ¶
type Webhook struct { ID bson.ObjectId `json:"id" bson:"_id,omitempty"` // Type string `json:"type"` // Incoming || Outgoing types Enabled bool `json:"enabled"` // Token string `json:"token,omitempty"` // Incoming: the endpoint Identification || Outgoing: Any Name string `json:"name"` // Shared Description string `json:"description,omitempty"` // Shared Target string `json:"url,omitempty"` // Outgoing destination Trigger string `json:"trigger,omitempty"` // Outgoing activation Payload interface{} `json:"data"` // Shared }
Webhook is the definition of both a Incoming and Outgoing webhook