model

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 17, 2019 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Alert

type Alert struct {
	// ID is the ID of the alert.
	ID string
	// Name is the name of the alert.
	Name string
	// StartsAt is when the alert has been started.
	StartsAt time.Time
	// End is when the alert has been ended.
	EndsAt time.Time
	// Status is the status of the alert.
	Status AlertStatus
	// Labels is data that defines the alert.
	Labels map[string]string
	// Annotations is a simple map of values that can be used to
	// add more info to the alert but don't define the alert nature
	// commonly this is used to add description, titles...
	Annotations map[string]string
	// GeneratorURL is the url that generated the alert (eg. Prometheus metrics).
	GeneratorURL string
}

Alert represents an alert.

func (Alert) IsFiring

func (a Alert) IsFiring() bool

IsFiring returns if the alerts is firing.

type AlertGroup

type AlertGroup struct {
	// ID is the group of alerts ID.
	ID string
	// Labels are the labels of the group.
	Labels map[string]string
	// Alerts are the alerts in the group.
	Alerts []Alert
}

AlertGroup is a group of alerts that share some of the information like the state, common metadata... and can be grouped in order to notify at the same time.

type AlertStatus

type AlertStatus int

AlertStatus is the status of an alert.

const (
	// AlertStatusUnknown is unknown alert status.
	AlertStatusUnknown AlertStatus = iota
	// AlertStatusFiring is when the alert is active and firing.
	AlertStatusFiring
	// AlertStatusResolved is when the alert was being triggered and now
	// is not being triggered anymore.
	AlertStatusResolved
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL