prometheus

package
v0.0.0-...-0145ae5 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrAlertNotFiring = errors.New("alerts are not firing (or pending)")

Functions

This section is empty.

Types

type AlertQueryResult

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

func (*AlertQueryResult) ToEvents

func (r *AlertQueryResult) ToEvents(includePending bool) ([]events.Event, error)

ToEvents get the Events for the alert name.

type EventProducer

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

func NewEventProducer

func NewEventProducer(cfg PrometheusConfig, prd producer.EventProducer) *EventProducer

NewEventProducer creation function for a new Prometheus EventProducer

func (*EventProducer) Key

func (d *EventProducer) Key() manager.ObjectKey

func (*EventProducer) Publish

func (d *EventProducer) Publish(topic string, event events.Event) error

Publish send the event to the bus, retrying on any errors

func (*EventProducer) Start

func (d *EventProducer) Start(done <-chan struct{}) error

Start called to start this EventProducer publishing to the event bus.

type PrometheusConfig

type PrometheusConfig struct {
	PollInterval   time.Duration
	IncludePending bool
	Key            manager.ObjectKey
	Client         *PrometheusService
}

type PrometheusService

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

func NewPrometheusClient

func NewPrometheusClient(address, username, password string) (*PrometheusService, error)

func NewPrometheusService

func NewPrometheusService(api v1.API) *PrometheusService

func (*PrometheusService) GetActiveAlerts

func (ps *PrometheusService) GetActiveAlerts() (AlertQueryResult, error)

Jump to

Keyboard shortcuts

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