alert

package
v0.0.0-...-712da53 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2025 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher struct {
	// SourceID -> *AlertSourceEnricher
	EnricherMap sync.Map
	// SourceName -> *AlertSourceEnricher
	SourceName2EnricherMap sync.Map
}

func (*Dispatcher) AddAlertSource

func (d *Dispatcher) AddAlertSource(
	source *alert.SourceFrom, enricher *enrich.AlertEnricher,
)

func (*Dispatcher) AddOrUpdateAlertSourceRule

func (d *Dispatcher) AddOrUpdateAlertSourceRule(
	source alert.SourceFrom, enricher *enrich.AlertEnricher,
)

AddOrUpdateAlertSourceRule

func (*Dispatcher) DeleteAlertSource

func (d *Dispatcher) DeleteAlertSource(
	source *alert.AlertSource,
)

func (*Dispatcher) DispatchEvents

func (d *Dispatcher) DispatchEvents(
	source alert.SourceFrom, events []alert.AlertEvent,
) error

type Service

type Service interface {
	CreateAlertSource(source *alert.AlertSource) (*alert.AlertSource, error)
	GetAlertSource(source *alert.SourceFrom) (*alert.AlertSource, error)
	UpdateAlertSource(source *alert.AlertSource) (*alert.AlertSource, error)
	DeleteAlertSource(source alert.SourceFrom) (*alert.AlertSource, error)
	ListAlertSource() ([]alert.AlertSource, error)

	UpdateAlertEnrichRule(*alert.AlerEnrichRuleConfigRequest) error
	GetAlertEnrichRule(sourceID string) ([]alert.AlertEnrichRuleVO, error)

	ProcessAlertEvents(source alert.SourceFrom, data []byte) error

	GetAlertEnrichRuleTags() ([]alert.TargetTag, error)

	CreateSchema(req *alert.CreateSchemaRequest) error
	DeleteSchema(schema string) error
	ListSchema() ([]string, error)
	ListSchemaColumns(schema string) ([]string, error)
	UpdateSchemaData(req *alert.UpdateSchemaDataRequest) error
	CheckSchemaIsUsed(schema string) ([]string, error)
	GetSchemaData(schema string) ([]string, map[int64][]string, error)

	CreateCluster(cluster *alert.Cluster) error
	ListCluster() ([]alert.Cluster, error)
	UpdateCluster(cluster *alert.Cluster) error
	DeleteCluster(cluster *alert.Cluster) error

	GetDefaultAlertEnrichRule(sourceType string) (string, []alert.AlertEnrichRuleVO)
	ClearDefaultAlertEnrichRule(sourceType string) (bool, error)
	SetDefaultAlertEnrichRule(sourceType string, tagEnrichRules []alert.AlertEnrichRuleVO) error
}

func New

func New(
	promRepo prometheus.Repo,
	dbRepo database.Repo,
	chRepo clickhouse.Repo,
) Service

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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