alarms

package
v0.10.0-rc4 Latest Latest
Warning

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

Go to latest
Published: May 31, 2023 License: Apache-2.0 Imports: 54 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAgentDurableReplayConsumer

func NewAgentDurableReplayConsumer(clusterId string) *nats.ConsumerConfig

func NewAgentStream

func NewAgentStream() *nats.StreamConfig

func NewAgentStreamSubject

func NewAgentStreamSubject(clusterId string) string

func NewCortexStatusStream

func NewCortexStatusStream() *nats.StreamConfig

func NewCortexStatusSubject

func NewCortexStatusSubject() string

func NewDurableAgentReplaySubject

func NewDurableAgentReplaySubject(clusterId string) string

Types

type AlarmServerComponent

type AlarmServerComponent struct {
	alertingv1.UnsafeAlertConditionsServer

	util.Initializer
	// contains filtered or unexported fields
}

func NewAlarmServerComponent

func NewAlarmServerComponent(
	ctx context.Context,
	logger *zap.SugaredLogger,
	notifications *notifications.NotificationServerComponent,
) *AlarmServerComponent

func (*AlarmServerComponent) ActivateSilence

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

func (*AlarmServerComponent) AlertConditionStatus

func (*AlarmServerComponent) CloneTo

func (*AlarmServerComponent) CreateAlertCondition

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

func (*AlarmServerComponent) DeactivateSilence

func (a *AlarmServerComponent) DeactivateSilence(ctx context.Context, ref *corev1.Reference) (*emptypb.Empty, error)

func (*AlarmServerComponent) DeleteAlertCondition

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

func (*AlarmServerComponent) GetAlertCondition

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

func (*AlarmServerComponent) Initialize

func (a *AlarmServerComponent) Initialize(conf AlarmServerConfiguration)

func (*AlarmServerComponent) ListAlertConditionChoices

func (*AlarmServerComponent) ListAlertConditions

func (*AlarmServerComponent) ListAlertConditionsWithStatus

func (a *AlarmServerComponent) ListAlertConditionsWithStatus(ctx context.Context, req *alertingv1.ListStatusRequest) (*alertingv1.ListStatusResponse, error)

func (*AlarmServerComponent) SetConfig

func (a *AlarmServerComponent) SetConfig(conf struct{})

func (*AlarmServerComponent) Status

func (a *AlarmServerComponent) Status() struct{}

func (*AlarmServerComponent) Sync

func (a *AlarmServerComponent) Sync(enabled bool) error

func (*AlarmServerComponent) Timeline

func (*AlarmServerComponent) UpdateAlertCondition

type EvaluatorContext

type EvaluatorContext struct {
	Ctx    context.Context
	Cancel context.CancelFunc
	// contains filtered or unexported fields
}

type InternalConditionEvaluator

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

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

func NewInternalConditionEvaluator

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

func (*InternalConditionEvaluator[T]) CalculateInitialState

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

func (*InternalConditionEvaluator[T]) EvaluateLoop

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

infinite & blocking : must be run in a goroutine

func (*InternalConditionEvaluator[T]) IsFiring

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

func (*InternalConditionEvaluator[T]) SetFiring

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

func (*InternalConditionEvaluator[T]) SubscriberLoop

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

infinite & blocking : must be run in a goroutine

func (*InternalConditionEvaluator[T]) UpdateState

type Runner

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

func NewRunner

func NewRunner() *Runner

func (*Runner) AddSystemConfigListener

func (n *Runner) AddSystemConfigListener(conditionId string, eCtx EvaluatorContext)

func (*Runner) IsRunning

func (n *Runner) IsRunning(conditionId string) bool

func (*Runner) RemoveConfigListener

func (n *Runner) RemoveConfigListener(conditionId string)

Jump to

Keyboard shortcuts

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