event

package
v0.0.0-...-5167e8f Latest Latest
Warning

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

Go to latest
Published: Dec 13, 2024 License: AGPL-3.0 Imports: 34 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConcatOutputAndRuleName

func ConcatOutputAndRuleName(output, ruleName string) string

func NewAlarmStep

func NewAlarmStep(t string, params rpc.AxeParameters, inPbehaviorInterval bool) types.AlarmStep

func NewPbhAlarmStep

func NewPbhAlarmStep(t string, params rpc.AxeParameters, pbehaviorInfo types.PbehaviorInfo) types.AlarmStep

Types

type AutoInstructionMatcher

type AutoInstructionMatcher interface {
	Load(ctx context.Context) error
	Match(triggers []string, alarmWithEntity types.AlarmWithEntity) (bool, error)
}

func NewNullAutoInstructionMatcher

func NewNullAutoInstructionMatcher() AutoInstructionMatcher

type MetaAlarmPostProcessor

type MetaAlarmPostProcessor interface {
	// Process handles related meta alarm parents and children after alarm change.
	Process(ctx context.Context, event rpc.AxeEvent, eventRes rpc.AxeResultEvent) error
}

func NewMetaAlarmPostProcessor

func NewMetaAlarmPostProcessor(
	dbClient mongo.DbClient,
	adapter libalarm.Adapter,
	ruleAdapter correlation.RulesAdapter,
	alarmStatusService alarmstatus.Service,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	encoder encoding.Encoder,
	eventGenerator event.Generator,
	amqpPublisher libamqp.Publisher,
	metricsSender metrics.Sender,
	logger zerolog.Logger,
) MetaAlarmPostProcessor

type Processor

type Processor interface {
	Process(ctx context.Context, event rpc.AxeEvent) (Result, error)
}

func NewAckProcessor

func NewAckProcessor(
	client mongo.DbClient,
	configProvider config.AlarmConfigProvider,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	logger zerolog.Logger,
) Processor

func NewAckRemoveProcessor

func NewAckRemoveProcessor(
	client mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	logger zerolog.Logger,
) Processor

func NewActivateProcessor

func NewActivateProcessor(
	client mongo.DbClient,
	autoInstructionMatcher AutoInstructionMatcher,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewAssocTicketProcessor

func NewAssocTicketProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	logger zerolog.Logger,
) Processor

func NewAutoInstructionActivateProcessor

func NewAutoInstructionActivateProcessor(
	client mongo.DbClient,
) Processor

func NewAutoWebhookCompleteProcessor

func NewAutoWebhookCompleteProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	logger zerolog.Logger,
) Processor

func NewAutoWebhookFailProcessor

func NewAutoWebhookFailProcessor(
	client mongo.DbClient,
) Processor

func NewAutoWebhookStartProcessor

func NewAutoWebhookStartProcessor(
	client mongo.DbClient,
) Processor

func NewCancelProcessor

func NewCancelProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	logger zerolog.Logger,
) Processor

func NewChangeStateProcessor

func NewChangeStateProcessor(
	client mongo.DbClient,
	userInterfaceConfigProvider config.UserInterfaceConfigProvider,
	alarmStatusService alarmstatus.Service,
	autoInstructionMatcher AutoInstructionMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewCheckProcessor

func NewCheckProcessor(
	client mongo.DbClient,
	alarmConfigProvider config.AlarmConfigProvider,
	alarmStatusService alarmstatus.Service,
	pbhTypeResolver pbehavior.EntityTypeResolver,
	autoInstructionMatcher AutoInstructionMatcher,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	eventStatisticsSender statistics.EventStatisticsSender,
	remediationRpcClient engine.RPCClient,
	externalTagUpdater alarmtag.ExternalUpdater,
	internalTagAlarmMatcher alarmtag.InternalTagAlarmMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewCombinedProcessor

func NewCombinedProcessor(container ProcessorContainer) Processor

func NewCommentProcessor

func NewCommentProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	logger zerolog.Logger,
) Processor

func NewDeclareTicketWebhookProcessor

func NewDeclareTicketWebhookProcessor(
	client mongo.DbClient,
	metricsSender metrics.Sender,
	amqpPublisher libamqp.Publisher,
	eventGenerator event.Generator,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewEntityToggledProcessor

func NewEntityToggledProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewEntityUpdatedProcessor

func NewEntityUpdatedProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
) Processor

func NewForwardProcessor

func NewForwardProcessor() Processor

func NewForwardWithAlarmProcessor

func NewForwardWithAlarmProcessor(
	client mongo.DbClient,
) Processor

func NewInstructionProcessor

func NewInstructionProcessor(
	client mongo.DbClient,
	metricsSender metrics.Sender,
	amqpPublisher libamqp.Publisher,
	eventGenerator event.Generator,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewJunitProcessor

func NewJunitProcessor(
	client mongo.DbClient,
) Processor

func NewMetaAlarmAttachProcessor

func NewMetaAlarmAttachProcessor(
	dbClient mongo.DbClient,
	ruleAdapter correlation.RulesAdapter,
	adapter libalarm.Adapter,
	alarmStatusService alarmstatus.Service,
	templateExecutor template.Executor,
	metricsSender metrics.Sender,
	encoder encoding.Encoder,
	eventGenerator libevent.Generator,
	amqpPublisher libamqp.Publisher,
	logger zerolog.Logger,
) Processor

func NewMetaAlarmChildActivateProcessor

func NewMetaAlarmChildActivateProcessor(
	client mongo.DbClient,
) Processor

func NewMetaAlarmChildDeactivateProcessor

func NewMetaAlarmChildDeactivateProcessor(
	client mongo.DbClient,
) Processor

func NewMetaAlarmDetachProcessor

func NewMetaAlarmDetachProcessor(
	dbClient mongo.DbClient,
	ruleAdapter correlation.RulesAdapter,
	adapter libalarm.Adapter,
	alarmStatusService alarmstatus.Service,
	templateExecutor template.Executor,
) Processor

func NewMetaAlarmProcessor

func NewMetaAlarmProcessor(
	autoInstructionMatcher AutoInstructionMatcher,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	dbClient mongo.DbClient,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	adapter libalarm.Adapter,
	ruleAdapter correlation.RulesAdapter,
	pbhTypeResolver pbehavior.EntityTypeResolver,
	alarmStatusService alarmstatus.Service,
	alarmConfigProvider config.AlarmConfigProvider,
	templateExecutor template.Executor,
	encoder encoding.Encoder,
	eventGenerator libevent.Generator,
	amqpPublisher libamqp.Publisher,
	logger zerolog.Logger,
) Processor

func NewNoEventsProcessor

func NewNoEventsProcessor(
	client mongo.DbClient,
	alarmConfigProvider config.AlarmConfigProvider,
	alarmStatusService alarmstatus.Service,
	pbhTypeResolver pbehavior.EntityTypeResolver,
	autoInstructionMatcher AutoInstructionMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	internalTagAlarmMatcher alarmtag.InternalTagAlarmMatcher,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewPbhEnterProcessor

func NewPbhEnterProcessor(
	client mongo.DbClient,
	autoInstructionMatcher AutoInstructionMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewPbhLeaveAndEnterProcessor

func NewPbhLeaveAndEnterProcessor(
	client mongo.DbClient,
	autoInstructionMatcher AutoInstructionMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewPbhLeaveProcessor

func NewPbhLeaveProcessor(
	client mongo.DbClient,
	autoInstructionMatcher AutoInstructionMatcher,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewRecomputeEntityServiceProcessor

func NewRecomputeEntityServiceProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewResolveCancelProcessor

func NewResolveCancelProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewResolveCloseProcessor

func NewResolveCloseProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewResolveDeletedProcessor

func NewResolveDeletedProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	componentCountersCalculator calculator.ComponentCountersCalculator,
	eventsSender entitycounters.EventsSender,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metaAlarmStatesService correlation.MetaAlarmStateService,
	metricsSender metrics.Sender,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewSnoozeProcessor

func NewSnoozeProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	logger zerolog.Logger,
) Processor

func NewTriggerProcessor

func NewTriggerProcessor(
	client mongo.DbClient,
) Processor

func NewUncancelProcessor

func NewUncancelProcessor(
	dbClient mongo.DbClient,
	alarmStatusService alarmstatus.Service,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	logger zerolog.Logger,
) Processor

func NewUnsnoozeProcessor

func NewUnsnoozeProcessor(
	client mongo.DbClient,
	autoInstructionMatcher AutoInstructionMatcher,
	remediationRpcClient engine.RPCClient,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewUpdateCountersProcessor

func NewUpdateCountersProcessor(
	dbClient mongo.DbClient,
	entityServiceCountersCalculator calculator.EntityServiceCountersCalculator,
	eventsSender entitycounters.EventsSender,
) Processor

func NewUpdateStatusProcessor

func NewUpdateStatusProcessor(
	dbClient mongo.DbClient,
	alarmStatusService alarmstatus.Service,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	logger zerolog.Logger,
) Processor

func NewWebhookCompleteProcessor

func NewWebhookCompleteProcessor(
	client mongo.DbClient,
	metaAlarmPostProcessor MetaAlarmPostProcessor,
	metricsSender metrics.Sender,
	amqpPublisher libamqp.Publisher,
	eventGenerator event.Generator,
	encoder encoding.Encoder,
	logger zerolog.Logger,
) Processor

func NewWebhookFailProcessor

func NewWebhookFailProcessor(
	client mongo.DbClient,
) Processor

func NewWebhookStartProcessor

func NewWebhookStartProcessor(
	client mongo.DbClient,
) Processor

type ProcessorContainer

type ProcessorContainer interface {
	Get(eventType string) (Processor, bool)
	Set(eventType string, p Processor)
	Has(eventType string) bool
}

func NewProcessorContainer

func NewProcessorContainer() ProcessorContainer

type Result

type Result struct {
	Alarm       types.Alarm
	Entity      types.Entity
	AlarmChange types.AlarmChange

	Forward              bool
	IsInstructionMatched bool
	IsCountersUpdated    bool
}

Jump to

Keyboard shortcuts

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