backends

package
v0.0.0-...-e8cbd8a Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2022 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DatabaseTotal = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "database_total",
			Help: "Total number of items in the database",
		})
	DatabaseFiring = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "database_firing",
			Help: "Total number of firing alerts in the database",
		})
	DatabaseResolved = prometheus.NewGauge(
		prometheus.GaugeOpts{
			Name: "database_resolved",
			Help: "Total number of resolved alerts in the database",
		})
	DatabasePruned = prometheus.NewGaugeVec(
		prometheus.GaugeOpts{
			Name: "database_pruned",
			Help: "Total number of alerts pruned",
		},
		[]string{"reason"},
	)
	Operations = prometheus.NewSummaryVec(
		prometheus.SummaryOpts{
			Name: "database_operation_duration_microseconds",
			Help: "Total duration and counts of database methods",
		},
		[]string{"type"},
	)
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	Import(*models.Alert)
	Export(models.NotificationSender)
	Prune()
	CalculateLastAlert() float64
	DebugHandler(w http.ResponseWriter, r *http.Request)
}

type BasicBackend

type BasicBackend struct {
	// contains filtered or unexported fields
}

func NewBasicBackend

func NewBasicBackend() *BasicBackend

func (*BasicBackend) CalculateLastAlert

func (set *BasicBackend) CalculateLastAlert() float64

func (*BasicBackend) DebugHandler

func (set *BasicBackend) DebugHandler(w http.ResponseWriter, r *http.Request)

func (*BasicBackend) Export

func (set *BasicBackend) Export(notifier models.NotificationSender)

Build list of alerts to send to alertmanager Pass the send function here so that we can manage locks from this

func (*BasicBackend) Import

func (set *BasicBackend) Import(alert *models.Alert)

Add a Nagios Alert

func (*BasicBackend) Prune

func (set *BasicBackend) Prune()

Jump to

Keyboard shortcuts

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