alertmanager

package
v0.23.0 Latest Latest
Warning

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

Go to latest
Published: Nov 6, 2025 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InfoSeverity     = "INFO"
	WarningSeverity  = "WARNING"
	CriticalSeverity = "CRITICAL"
	DefaultSeverity  = WarningSeverity

	DefaultChannelLabel = "team"
	SeverityLabel       = "severity"
	EnvironmentLabel    = "environment"
)
View Source
const (
	MetricNotificationQueue         = "notification_received_total"
	MetricNotificationWorkerSendErr = "notification_err_total"
	MetricNotificationSend          = "notification_sent_successfully"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AlertManager

type AlertManager struct {
	io.Closer
	// contains filtered or unexported fields
}

func New

func New(ctx context.Context, logger log.Logger, host, endpoint, dashboard, dataConsole string, alertsRepo AlertsRepo) *AlertManager

func (*AlertManager) Close

func (a *AlertManager) Close() error

func (*AlertManager) PrepareAndSendEvent added in v0.16.2

func (a *AlertManager) PrepareAndSendEvent(alertPayload *AlertPayload) error

func (*AlertManager) SendExternalTableEvent added in v0.19.0

func (a *AlertManager) SendExternalTableEvent(attr *resource.ETAlertAttrs)

func (*AlertManager) SendJobEvent added in v0.16.2

func (a *AlertManager) SendJobEvent(attr *job.AlertAttrs)

func (*AlertManager) SendJobRunEvent added in v0.16.2

func (a *AlertManager) SendJobRunEvent(e *scheduler.AlertAttrs)

func (*AlertManager) SendOperatorSLAEvent added in v0.22.0

func (a *AlertManager) SendOperatorSLAEvent(attr *scheduler.OperatorSLAAlertAttrs)

func (*AlertManager) SendPotentialSLABreach added in v0.22.4

func (a *AlertManager) SendPotentialSLABreach(attr *scheduler.PotentialSLABreachAttrs)

func (*AlertManager) SendReplayEvent added in v0.16.2

func (a *AlertManager) SendReplayEvent(attr *scheduler.ReplayNotificationAttrs)

func (*AlertManager) SendResourceEvent added in v0.16.2

func (a *AlertManager) SendResourceEvent(attr *resource.AlertAttrs)

type AlertPayload

type AlertPayload struct {
	Project  string                 `json:"-"`
	LogTag   string                 `json:"-"`
	Data     map[string]interface{} `json:"data"`
	Template string                 `json:"template"`
	Labels   map[string]string      `json:"labels"`
	Endpoint string                 `json:"-"`
}

func (*AlertPayload) HasDefaultChannelLabel added in v0.22.4

func (a *AlertPayload) HasDefaultChannelLabel() bool

type AlertStatus added in v0.22.4

type AlertStatus string
const (
	StatusPending AlertStatus = "PENDING"
	StatusSent    AlertStatus = "SENT"
	StatusFailed  AlertStatus = "FAILED"
)

type AlertsRepo added in v0.22.4

type AlertsRepo interface {
	Insert(ctx context.Context, payload *AlertPayload) (uuid.UUID, error)
	UpdateStatus(ctx context.Context, recordID uuid.UUID, status AlertStatus, message string) error
}

type ReplayEventType added in v0.17.0

type ReplayEventType string

func (ReplayEventType) String added in v0.17.0

func (j ReplayEventType) String() string

Jump to

Keyboard shortcuts

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