alarms

package
v0.12.1 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2023 License: Apache-2.0 Imports: 62 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DisconnectStreamEvaluateInterval = time.Second * 10
	CapabilityStreamEvaluateInterval = time.Second * 10
	CortexStreamEvaluateInterval     = time.Second * 30
)

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 AlarmMetricsExporter added in v0.11.0

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

func NewAlarmMetricsExporter added in v0.11.0

func NewAlarmMetricsExporter() *AlarmMetricsExporter

type AlarmServerComponent

type AlarmServerComponent struct {
	alertingv1.UnsafeAlertConditionsServer
	rules.UnsafeRuleSyncServer

	util.Initializer

	server.Config
	// contains filtered or unexported fields
}

func NewAlarmServerComponent

func NewAlarmServerComponent(
	ctx context.Context,
	logger *slog.Logger,
	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 (*AlarmServerComponent) DeactivateSilence

func (*AlarmServerComponent) DeleteAlertCondition

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

func (*AlarmServerComponent) GetAlertCondition

func (*AlarmServerComponent) Healthy added in v0.11.0

func (a *AlarmServerComponent) Healthy() bool

func (*AlarmServerComponent) Initialize

func (a *AlarmServerComponent) Initialize(conf AlarmServerConfiguration)

func (*AlarmServerComponent) ListAlertConditionChoices

func (*AlarmServerComponent) ListAlertConditionGroups added in v0.11.0

func (a *AlarmServerComponent) ListAlertConditionGroups(ctx context.Context, _ *emptypb.Empty) (*corev1.ReferenceList, error)

func (*AlarmServerComponent) ListAlertConditions

func (*AlarmServerComponent) ListAlertConditionsWithStatus

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

func (*AlarmServerComponent) Name added in v0.11.0

func (a *AlarmServerComponent) Name() string

func (*AlarmServerComponent) Ready added in v0.11.0

func (a *AlarmServerComponent) Ready() bool

func (*AlarmServerComponent) SetConfig

func (a *AlarmServerComponent) SetConfig(conf server.Config)

func (*AlarmServerComponent) Status

func (a *AlarmServerComponent) Status() server.Status

func (*AlarmServerComponent) Sync

func (*AlarmServerComponent) SyncRules added in v0.11.0

func (a *AlarmServerComponent) SyncRules(ctx context.Context, rules *rules.RuleManifest) (*emptypb.Empty, error)

func (*AlarmServerComponent) Timeline

func (*AlarmServerComponent) UpdateAlertCondition

type AlarmServerConfiguration

type AlarmServerConfiguration struct {
	spec.ConditionStorage
	spec.IncidentStorage
	spec.StateStorage
	spec.RouterStorage
	Js              nats.JetStreamContext
	MgmtClient      managementv1.ManagementClient
	AdminClient     cortexadmin.CortexAdminClient
	CortexOpsClient cortexops.CortexOpsClient
}

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