alerting

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: 75 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	SyncInterval      = time.Minute * 1
	ForceSyncInterval = time.Minute * 15
)
View Source
var (
	DefaultDisconnectAlarm = func(clusterId string) *alertingv1.AlertCondition {
		return &alertingv1.AlertCondition{
			Name:        "agent-disconnect",
			Description: "Alert when the downstream agent disconnects from the opni upstream",
			Labels:      []string{"agent-disconnect", "opni", "_default"},
			Severity:    alertingv1.OpniSeverity_Critical,
			AlertType: &alertingv1.AlertTypeDetails{
				Type: &alertingv1.AlertTypeDetails_System{
					System: &alertingv1.AlertConditionSystem{
						ClusterId: &corev1.Reference{Id: clusterId},
						Timeout:   durationpb.New(10 * time.Minute),
					},
				},
			},
		}
	}

	DefaultCapabilityHealthAlarm = func(clusterId string) *alertingv1.AlertCondition {
		return &alertingv1.AlertCondition{
			Name:        "agent-capability-unhealthy",
			Description: "Alert when some downstream agent capability becomes unhealthy",
			Labels:      []string{"agent-capability-health", "opni", "_default"},
			Severity:    alertingv1.OpniSeverity_Critical,
			AlertType: &alertingv1.AlertTypeDetails{
				Type: &alertingv1.AlertTypeDetails_DownstreamCapability{
					DownstreamCapability: &alertingv1.AlertConditionDownstreamCapability{
						ClusterId:       &corev1.Reference{Id: clusterId},
						CapabilityState: ListBadDefaultStatuses(),
						For:             durationpb.New(10 * time.Minute),
					},
				},
			},
		}
	}
)
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 RegisterCapabilityStatus added in v0.8.0

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

func Scheme

func Scheme(ctx context.Context) meta.Scheme

func UseCachingProvider added in v0.9.2

func UseCachingProvider(c caching.CachingProvider[proto.Message])

Types

type Plugin

type Plugin struct {
	alertops.UnsafeAlertingAdminServer
	alertops.ConfigReconcilerServer
	system.UnimplementedSystemPluginClient

	collector.CollectorServer

	*notifications.NotificationServerComponent
	*endpoints.EndpointServerComponent
	*alarms.AlarmServerComponent
	// contains filtered or unexported fields
}

func NewPlugin

func NewPlugin(ctx context.Context) *Plugin

func (*Plugin) Components added in v0.10.0

func (p *Plugin) Components() []server.ServerComponent

func (*Plugin) ConfigureCluster added in v0.11.0

func (p *Plugin) ConfigureCluster(ctx context.Context, configuration *alertops.ClusterConfiguration) (*emptypb.Empty, error)

func (*Plugin) ConfigureRoutes added in v0.12.0

func (p *Plugin) ConfigureRoutes(router *gin.Engine)

func (*Plugin) GetClusterConfiguration added in v0.11.0

func (p *Plugin) GetClusterConfiguration(ctx context.Context, _ *emptypb.Empty) (*alertops.ClusterConfiguration, error)

func (*Plugin) GetClusterStatus added in v0.11.0

func (p *Plugin) GetClusterStatus(ctx context.Context, _ *emptypb.Empty) (*alertops.InstallStatus, error)

func (*Plugin) Info added in v0.11.1

func (*Plugin) InstallCluster added in v0.11.0

func (p *Plugin) InstallCluster(ctx context.Context, _ *emptypb.Empty) (*emptypb.Empty, error)

func (*Plugin) StreamServers added in v0.11.0

func (p *Plugin) StreamServers() []streamext.Server

func (*Plugin) SyncConfig added in v0.11.1

func (*Plugin) UninstallCluster added in v0.11.0

func (p *Plugin) UninstallCluster(ctx context.Context, request *alertops.UninstallRequest) (*emptypb.Empty, error)

func (*Plugin) UseAPIExtensions

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

func (*Plugin) UseKeyValueStore added in v0.6.0

func (p *Plugin) UseKeyValueStore(client 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) UseStreamClient added in v0.12.0

func (p *Plugin) UseStreamClient(cc grpc.ClientConnInterface)

type RemoteInfo added in v0.11.1

type RemoteInfo struct {
	WhoAmI        string
	LastApplied   *timestamppb.Timestamp
	LastSyncState alertops.SyncState
	LastSyncId    string
}

type SyncController added in v0.11.0

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

func NewSyncController added in v0.11.0

func NewSyncController(lg *slog.Logger) SyncController

func (*SyncController) AddRemoteInfo added in v0.11.1

func (s *SyncController) AddRemoteInfo(LifecycleUuid string, info RemoteInfo)

func (*SyncController) AddSyncPusher added in v0.11.0

func (s *SyncController) AddSyncPusher(LifecycleUuid string, pusher chan *alertops.SyncRequest)

func (*SyncController) ListRemoteInfo added in v0.11.1

func (s *SyncController) ListRemoteInfo() map[string]RemoteInfo

func (*SyncController) PushOne added in v0.11.1

func (s *SyncController) PushOne(lifecycleId string, payload *syncPayload)

func (*SyncController) PushSyncReq added in v0.11.0

func (s *SyncController) PushSyncReq(payload *syncPayload)

func (*SyncController) RemoveRemoteInfo added in v0.11.1

func (s *SyncController) RemoveRemoteInfo(LifecycleUuid string)

func (*SyncController) RemoveSyncPusher added in v0.11.0

func (s *SyncController) RemoveSyncPusher(LifecycleUuid string)

type SyncMetricsExporter added in v0.11.0

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

func NewSyncMetricsExporter added in v0.11.0

func NewSyncMetricsExporter() *SyncMetricsExporter

Directories

Path Synopsis
alarms
v1
endpoints
v1
notifications
v1

Jump to

Keyboard shortcuts

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