Back to godoc.org

Package promalert

v0.0.0-...-d76060a
Latest Go to latest

The latest major version is .

Published: Jan 23, 2020 | License: Apache-2.0 | Module: github.com/banzaicloud/hollowtrees

Index

Constants

const (
	EventTopic   = "cloud.events.incoming"
	CETypePrefix = "prometheus.server.alert."
)

func NewEventDispatcher

func NewEventDispatcher(eb baseEventPublisher) *eventDispatcher

NewEventDispatcher returns a new event dispatcher

type Alert

type Alert struct {
	Labels       map[string]string `json:"labels"`
	Annotations  map[string]string `json:"annotations"`
	StartsAt     time.Time         `json:"startsAt"`
	EndsAt       time.Time         `json:"endsAt"`
	GeneratorURL string            `json:"generatorURL" validate:"url"`
}

Alert describes an incoming Prometheus alert

type Alerts

type Alerts []Alert

func (Alerts) Authorize

func (alerts Alerts) Authorize(user *auth.User) error

func (Alerts) Validate

func (alerts Alerts) Validate() error

type Config

type Config struct {
	// HTTP listen address
	ListenAddress string

	// JWT auth
	UseJWTAuth bool

	// JWT signing key
	JWTSigningKey string
}

func (Config) Validate

func (c Config) Validate() error

Validate checks that the configuration is valid.

type PromAlertHandler

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

PromAlertHandler describes a Prometheus alert handler

func New

func New(config Config, logger log.Logger, errorHandler emperror.Handler, eb eventPublisher) *PromAlertHandler

New returns an initialized PromAlertHandler

func (*PromAlertHandler) Run

func (p *PromAlertHandler) Run()

Run runs the alert handler HTTP listener

Package Files

Documentation was rendered with GOOS=linux and GOARCH=amd64.

Jump to identifier

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to identifier