Documentation
¶
Overview ¶
- Functions that handle each endpoint implementation update case - Functions that handle each alert condition case
Index ¶
- Constants
- Variables
- func ListBadDefaultStatuses() []string
- func ListCapabilityStatuses(capabilityName string) map[string][]health.ConditionStatus
- func NewAgentDurableReplayConsumer(clusterId string) *nats.ConsumerConfig
- func NewAgentStream() *nats.StreamConfig
- func NewAgentStreamSubject(clusterId string) string
- func NewCortexStatusStream() *nats.StreamConfig
- func NewCortexStatusSubject() string
- func NewDurableAgentReplaySubject(clusterId string) string
- func RegisterCapabilityStatus(capabilityName, condName string, availableStatuses []health.ConditionStatus)
- func Scheme(ctx context.Context) meta.Scheme
- type InternalConditionEvaluator
- func (c *InternalConditionEvaluator[T]) CalculateInitialState()
- func (c *InternalConditionEvaluator[T]) EvaluateLoop()
- func (c *InternalConditionEvaluator[T]) IsFiring() bool
- func (c *InternalConditionEvaluator[T]) SetFiring(firing bool)
- func (c *InternalConditionEvaluator[T]) SubscriberLoop()
- func (c *InternalConditionEvaluator[T]) UpdateState(ctx context.Context, s *alertingv1.CachedState) error
- type InternalConditionWatcher
- type ManagementWatcherHooks
- type Plugin
- func (p *Plugin) ActivateSilence(ctx context.Context, req *alertingv1.SilenceRequest) (*emptypb.Empty, error)
- func (p *Plugin) AlertConditionStatus(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertStatusResponse, error)
- func (p *Plugin) CloneTo(ctx context.Context, req *alertingv1.CloneToRequest) (*emptypb.Empty, error)
- func (p *Plugin) CreateAlertCondition(ctx context.Context, req *alertingv1.AlertCondition) (*corev1.Reference, error)
- func (p *Plugin) CreateAlertEndpoint(ctx context.Context, req *alertingv1.AlertEndpoint) (*corev1.Reference, error)
- func (p *Plugin) DeactivateSilence(ctx context.Context, req *corev1.Reference) (*emptypb.Empty, error)
- func (p *Plugin) DeleteAlertCondition(ctx context.Context, ref *corev1.Reference) (*emptypb.Empty, error)
- func (p *Plugin) DeleteAlertEndpoint(ctx context.Context, req *alertingv1.DeleteAlertEndpointRequest) (*alertingv1.InvolvedConditions, error)
- func (p *Plugin) GetAlertCondition(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertCondition, error)
- func (p *Plugin) GetAlertEndpoint(ctx context.Context, ref *corev1.Reference) (*alertingv1.AlertEndpoint, error)
- func (p *Plugin) ListAlertConditionChoices(ctx context.Context, req *alertingv1.AlertDetailChoicesRequest) (*alertingv1.ListAlertTypeDetails, error)
- func (p *Plugin) ListAlertConditions(ctx context.Context, req *alertingv1.ListAlertConditionRequest) (*alertingv1.AlertConditionList, error)
- func (p *Plugin) ListAlertEndpoints(ctx context.Context, req *alertingv1.ListAlertEndpointsRequest) (*alertingv1.AlertEndpointList, error)
- func (p *Plugin) ListRoutingRelationships(ctx context.Context, _ *emptypb.Empty) (*alertingv1.ListRoutingRelationshipsResponse, error)
- func (p *Plugin) ResolveAlerts(ctx context.Context, req *alertingv1.ResolveAlertsRequest) (*alertingv1.ResolveAlertsResponse, error)
- func (p *Plugin) TestAlertEndpoint(ctx context.Context, req *alertingv1.TestAlertEndpointRequest) (*alertingv1.TestAlertEndpointResponse, error)
- func (p *Plugin) Timeline(ctx context.Context, req *alertingv1.TimelineRequest) (*alertingv1.TimelineResponse, error)
- func (p *Plugin) TriggerAlerts(ctx context.Context, req *alertingv1.TriggerAlertsRequest) (*alertingv1.TriggerAlertsResponse, error)
- func (p *Plugin) UpdateAlertCondition(ctx context.Context, req *alertingv1.UpdateAlertConditionRequest) (*emptypb.Empty, error)
- func (p *Plugin) UpdateAlertEndpoint(ctx context.Context, req *alertingv1.UpdateAlertEndpointRequest) (*alertingv1.InvolvedConditions, error)
- func (p *Plugin) UseAPIExtensions(intf system.ExtensionClientInterface)
- func (p *Plugin) UseKeyValueStore(_ system.KeyValueStoreClient)
- func (p *Plugin) UseManagementAPI(client managementv1.ManagementClient)
- func (p *Plugin) UseWatchers(client managementv1.ManagementClient)
- type SimpleInternalConditionWatcher
- type WatcherHooks
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 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 RegisterCapabilityStatus ¶ added in v0.8.0
func RegisterCapabilityStatus(capabilityName, condName string, availableStatuses []health.ConditionStatus)
Types ¶
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
func (c *InternalConditionEvaluator[T]) UpdateState(ctx context.Context, s *alertingv1.CachedState) error
type InternalConditionWatcher ¶ added in v0.8.0
type InternalConditionWatcher interface {
WatchEvents()
}
type ManagementWatcherHooks ¶ added in v0.8.0
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 ¶
type Plugin struct { system.UnimplementedSystemPluginClient alertingv1.UnsafeAlertConditionsServer alertingv1.UnsafeAlertEndpointsServer alertingv1.UnsafeAlertTriggersServer Ctx context.Context Logger *zap.SugaredLogger // contains filtered or unexported fields }
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 (*Plugin) DeleteAlertEndpoint ¶
func (p *Plugin) DeleteAlertEndpoint(ctx context.Context, req *alertingv1.DeleteAlertEndpointRequest) (*alertingv1.InvolvedConditions, 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) ListAlertConditions ¶
func (p *Plugin) ListAlertConditions(ctx context.Context, req *alertingv1.ListAlertConditionRequest) (*alertingv1.AlertConditionList, error)
func (*Plugin) ListAlertEndpoints ¶
func (p *Plugin) ListAlertEndpoints(ctx context.Context, req *alertingv1.ListAlertEndpointsRequest) (*alertingv1.AlertEndpointList, error)
func (*Plugin) ListRoutingRelationships ¶ added in v0.6.1
func (p *Plugin) ListRoutingRelationships(ctx context.Context, _ *emptypb.Empty) (*alertingv1.ListRoutingRelationshipsResponse, error)
func (*Plugin) ResolveAlerts ¶ added in v0.8.0
func (p *Plugin) ResolveAlerts(ctx context.Context, req *alertingv1.ResolveAlertsRequest) (*alertingv1.ResolveAlertsResponse, error)
func (*Plugin) TestAlertEndpoint ¶
func (p *Plugin) TestAlertEndpoint(ctx context.Context, req *alertingv1.TestAlertEndpointRequest) (*alertingv1.TestAlertEndpointResponse, error)
func (*Plugin) Timeline ¶ added in v0.6.1
func (p *Plugin) Timeline(ctx context.Context, req *alertingv1.TimelineRequest) (*alertingv1.TimelineResponse, error)
func (*Plugin) TriggerAlerts ¶
func (p *Plugin) TriggerAlerts(ctx context.Context, req *alertingv1.TriggerAlertsRequest) (*alertingv1.TriggerAlertsResponse, error)
--- 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) UpdateAlertEndpoint ¶
func (p *Plugin) UpdateAlertEndpoint(ctx context.Context, req *alertingv1.UpdateAlertEndpointRequest) (*alertingv1.InvolvedConditions, error)
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()
Source Files
¶
Click to show internal directories.
Click to hide internal directories.