promalert

package
v0.0.0-...-d76060a Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

func NewEventDispatcher

func NewEventDispatcher(eb baseEventPublisher) *eventDispatcher

NewEventDispatcher returns a new event dispatcher

Types

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

Jump to

Keyboard shortcuts

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