monitoring

package
v0.0.0-...-b1767e8 Latest Latest
Warning

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

Go to latest
Published: Jan 20, 2022 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventWatchNotifier

type EventWatchNotifier interface {
	Register(ref *typesCoreV1.ObjectReference) error
	Unregister(ref *typesCoreV1.ObjectReference) error
}

EventWatchNotifier allows to watch events for a given Pod and send notification to Slack if received event Type is different that `Normal`

type Labels

type Labels map[string]string

Labels describes the common type for labels field

type Observable

type Observable struct {
	Namespace       string
	PodLabelsGroups []Labels
}

Observable defines which Pods should be observed

type PodDetector

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

PodDetector dynamically register and unregister Pods for event watching. Registered Pods belongs to requested Deployments.

func NewPodDetector

func NewPodDetector(podInformer informersCoreV1.PodInformer, watcher EventWatchNotifier, log logrus.FieldLogger, observables ...Observable) *PodDetector

NewPodDetector returns new instance of the PodDetector

func (*PodDetector) Start

func (e *PodDetector) Start() error

Start starts the process of registering Pods from given Deployment into EventWatcher

type SlackNotifier

type SlackNotifier interface {
	Notify(id, header, details string) error
}

SlackNotifier allows sending notification about messages to Slack channel.

type WatcherService

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

WatcherService allows to watch events for a given Pod and send notification to Slack if received event Type is different that `Normal`

func NewWatcherService

func NewWatcherService(eventCli corev1.CoreV1Interface, slackNotifier SlackNotifier, log logrus.FieldLogger) *WatcherService

NewWatcherService returns new instance of the WatcherService

func (*WatcherService) Register

func (s *WatcherService) Register(ref *v1.ObjectReference) error

Register registers given obj and starts watching events from it. Error is not returned when object with the same Name is already registered.

func (*WatcherService) Unregister

func (s *WatcherService) Unregister(ref *v1.ObjectReference) error

Unregister removes obj from watcher list and stop watching the events from it. Error is not returned when object was not registered.

Jump to

Keyboard shortcuts

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