alerting

package
v0.9.0-rc3 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0 Imports: 59 Imported by: 0

Documentation

Overview

- Functions that handle each endpoint implementation update case - Functions that handle each alert condition case

Index

Constants

View Source
const AlertingLogCacheSize = 32
View Source
const ApiExtensionBackoff = time.Second * 5

Variables

View Source
var RegisteredCapabilityStatuses = map[string]map[string][]health.ConditionStatus{}

Functions

func ListBadDefaultStatuses added in v0.8.0

func ListBadDefaultStatuses() []string

func ListCapabilityStatuses added in v0.8.0

func ListCapabilityStatuses(capabilityName string) map[string][]health.ConditionStatus

func NewAgentDurableReplayConsumer added in v0.8.0

func NewAgentDurableReplayConsumer(clusterId string) *nats.ConsumerConfig

func NewAgentStream added in v0.8.0

func NewAgentStream() *nats.StreamConfig

func NewAgentStreamSubject added in v0.8.0

func NewAgentStreamSubject(clusterId string) string

func NewCortexStatusStream added in v0.8.0

func NewCortexStatusStream() *nats.StreamConfig

func NewCortexStatusSubject added in v0.8.0

func NewCortexStatusSubject() string

func NewDurableAgentReplaySubject added in v0.8.0

func NewDurableAgentReplaySubject(clusterId string) string

func RegisterCapabilityStatus added in v0.8.0

func RegisterCapabilityStatus(capabilityName, condName string, availableStatuses []health.ConditionStatus)

func Scheme

func Scheme(ctx context.Context) meta.Scheme

Types

type AlertStatusNotification added in v0.8.3

type AlertStatusNotification lo.Tuple2[*alertingv1.AlertStatusResponse, error]

type ClusterMap added in v0.8.3

type ClusterMap map[string]*corev1.Cluster

type InternalConditionEvaluator added in v0.8.0

type InternalConditionEvaluator[T proto.Message] struct {
	// contains filtered or unexported fields
}

--------------------------------

func NewInternalConditionEvaluator added in v0.8.0

func NewInternalConditionEvaluator[T proto.Message](
	metadata *internalConditionMetadata,
	context *internalConditionContext,
	storage *internalConditionStorage,
	state *internalConditionState,
	hooks *internalConditionHooks[T],
) *InternalConditionEvaluator[T]

func (*InternalConditionEvaluator[T]) CalculateInitialState added in v0.8.0

func (c *InternalConditionEvaluator[T]) CalculateInitialState()

func (*InternalConditionEvaluator[T]) EvaluateLoop added in v0.8.0

func (c *InternalConditionEvaluator[T]) EvaluateLoop()

infinite & blocking : must be run in a goroutine

func (*InternalConditionEvaluator[T]) IsFiring added in v0.8.0

func (c *InternalConditionEvaluator[T]) IsFiring() bool

func (*InternalConditionEvaluator[T]) SetFiring added in v0.8.0

func (c *InternalConditionEvaluator[T]) SetFiring(firing bool)

func (*InternalConditionEvaluator[T]) SubscriberLoop added in v0.8.0

func (c *InternalConditionEvaluator[T]) SubscriberLoop()

infinite & blocking : must be run in a goroutine

func (*InternalConditionEvaluator[T]) UpdateState added in v0.8.0

type InternalConditionWatcher added in v0.8.0

type InternalConditionWatcher interface {
	WatchEvents()
}

type ManagementWatcherHooks added in v0.8.0

type ManagementWatcherHooks[T proto.Message] struct {
	// contains filtered or unexported fields
}

func NewDefaultClusterWatcherHooks added in v0.8.0

func NewDefaultClusterWatcherHooks[T proto.Message](parentCtx context.Context) *ManagementWatcherHooks[T]

func (*ManagementWatcherHooks[T]) HandleEvent added in v0.8.0

func (c *ManagementWatcherHooks[T]) HandleEvent(event T)

func (*ManagementWatcherHooks[T]) RegisterEvent added in v0.8.0

func (c *ManagementWatcherHooks[T]) RegisterEvent(eventFilter func(T) bool, hook ...func(context.Context, T) error)

type Plugin

func NewPlugin

func NewPlugin(ctx context.Context) *Plugin

func (*Plugin) ActivateSilence added in v0.6.0

func (p *Plugin) ActivateSilence(ctx context.Context, req *alertingv1.SilenceRequest) (*emptypb.Empty, error)

func (*Plugin) AlertConditionStatus added in v0.6.0

func (p *Plugin) AlertConditionStatus(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertStatusResponse, error)

func (*Plugin) CloneTo added in v0.8.0

func (p *Plugin) CloneTo(ctx context.Context, req *alertingv1.CloneToRequest) (*emptypb.Empty, error)

func (*Plugin) CreateAlertCondition

func (p *Plugin) CreateAlertCondition(ctx context.Context, req *alertingv1.AlertCondition) (*corev1.Reference, error)

always overwrites id field

func (*Plugin) CreateAlertEndpoint

func (p *Plugin) CreateAlertEndpoint(ctx context.Context, req *alertingv1.AlertEndpoint) (*corev1.Reference, error)

func (*Plugin) DeactivateSilence added in v0.6.0

func (p *Plugin) DeactivateSilence(ctx context.Context, req *corev1.Reference) (*emptypb.Empty, error)

DeactivateSilence req.Id is a condition id reference

func (*Plugin) DeleteAlertCondition

func (p *Plugin) DeleteAlertCondition(ctx context.Context, ref *corev1.Reference) (*emptypb.Empty, error)

func (*Plugin) GetAlertCondition

func (p *Plugin) GetAlertCondition(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertCondition, error)

func (*Plugin) GetAlertEndpoint

func (p *Plugin) GetAlertEndpoint(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertEndpoint, error)

func (*Plugin) ListAlertConditionChoices added in v0.6.0

func (p *Plugin) ListAlertConditionChoices(ctx context.Context, req *alertingv1.AlertDetailChoicesRequest) (*alertingv1.ListAlertTypeDetails, error)

func (*Plugin) ListAlertConditionsWithStatus added in v0.8.3

func (p *Plugin) ListAlertConditionsWithStatus(ctx context.Context, req *alertingv1.ListStatusRequest) (*alertingv1.ListStatusResponse, error)

func (*Plugin) ListRoutingRelationships added in v0.6.1

func (p *Plugin) ListRoutingRelationships(ctx context.Context, _ *emptypb.Empty) (*alertingv1.ListRoutingRelationshipsResponse, error)

func (*Plugin) PushNotification added in v0.8.3

func (p *Plugin) PushNotification(ctx context.Context, req *alertingv1.Notification) (*emptypb.Empty, error)

func (*Plugin) ResolveAlerts added in v0.8.0

func (*Plugin) Timeline added in v0.6.1

func (*Plugin) ToggleNotifications added in v0.8.3

func (p *Plugin) ToggleNotifications(ctx context.Context, req *alertingv1.ToggleRequest) (*emptypb.Empty, error)

func (*Plugin) TriggerAlerts

--- Trigger ---

func (*Plugin) UpdateAlertCondition

func (p *Plugin) UpdateAlertCondition(ctx context.Context, req *alertingv1.UpdateAlertConditionRequest) (*emptypb.Empty, error)

req.Id is the condition id reference

func (*Plugin) UseAPIExtensions

func (p *Plugin) UseAPIExtensions(intf system.ExtensionClientInterface)

func (*Plugin) UseKeyValueStore added in v0.6.0

func (p *Plugin) UseKeyValueStore(_ system.KeyValueStoreClient)

UseKeyValueStore Alerting Condition & Alert Endpoints are stored in K,V stores

func (*Plugin) UseManagementAPI

func (p *Plugin) UseManagementAPI(client managementv1.ManagementClient)

func (*Plugin) UseWatchers added in v0.8.0

func (p *Plugin) UseWatchers(client managementv1.ManagementClient)

type SimpleInternalConditionWatcher added in v0.8.0

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

func NewSimpleInternalConditionWatcher added in v0.8.0

func NewSimpleInternalConditionWatcher(cl ...func()) *SimpleInternalConditionWatcher

func (*SimpleInternalConditionWatcher) WatchEvents added in v0.8.0

func (s *SimpleInternalConditionWatcher) WatchEvents()

type StatusInfo added in v0.8.3

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

type WatcherHooks added in v0.8.0

type WatcherHooks[T any] interface {
	RegisterEvent(eventType func(T) bool, hooks ...func(context.Context, T) error)
	HandleEvent(T)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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