notifications

package
v1.18.7 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EnqueueResolvedAlerts added in v1.18.0

func EnqueueResolvedAlerts(database *db.DB, project *db.Project, alerts []*model.Alert, rule *model.AlertingRule)

Types

type AlertNotifier added in v1.18.0

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

func NewAlertNotifier added in v1.18.0

func NewAlertNotifier(database *db.DB) *AlertNotifier

func (*AlertNotifier) Enqueue added in v1.18.0

func (n *AlertNotifier) Enqueue(project *db.Project, app *model.Application, alert *model.Alert, rule *model.AlertingRule, now timeseries.Time)

type AlertTemplateValues added in v1.18.0

type AlertTemplateValues struct {
	Status      string              `json:"status"`
	ProjectName string              `json:"project_name"`
	Application model.ApplicationId `json:"application"`
	RuleName    string              `json:"rule_name"`
	Severity    string              `json:"severity"`
	Summary     string              `json:"summary"`
	Details     []model.AlertDetail `json:"details,omitempty"`
	Duration    string              `json:"duration,omitempty"`
	ResolvedBy  string              `json:"resolved_by,omitempty"`
	URL         string              `json:"url"`
}

type DeploymentTemplateValues added in v1.0.0

type DeploymentTemplateValues struct {
	Status      string              `json:"status"`
	Application model.ApplicationId `json:"application"`
	Version     string              `json:"version"`
	Summary     []string            `json:"summary"`
	URL         string              `json:"url"`
}

type IncidentNotifier

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

func NewIncidentNotifier

func NewIncidentNotifier(db *db.DB) *IncidentNotifier

func (*IncidentNotifier) Enqueue

func (n *IncidentNotifier) Enqueue(project *db.Project, app *model.Application, incident *model.ApplicationIncident, now timeseries.Time)

type IncidentTemplateValues added in v1.0.0

type IncidentTemplateValues struct {
	Status      string                                 `json:"status"`
	Application model.ApplicationId                    `json:"application"`
	Reports     []db.IncidentNotificationDetailsReport `json:"reports"`
	URL         string                                 `json:"url"`
}

type NotificationClient

type NotificationClient interface {
	SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error
	SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error
	SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error
}

type NotificationType added in v1.18.0

type NotificationType int
const (
	NotificationTypeIncident NotificationType = iota
	NotificationTypeAlert
)

type Opsgenie

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

func NewOpsgenie

func NewOpsgenie(apiKey string, euInstance bool) *Opsgenie

func (*Opsgenie) SendAlert added in v1.18.0

func (og *Opsgenie) SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error

func (*Opsgenie) SendDeployment added in v1.10.0

func (og *Opsgenie) SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error

func (*Opsgenie) SendIncident

func (og *Opsgenie) SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error

type Pagerduty

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

func NewPagerduty

func NewPagerduty(integrationKey string) *Pagerduty

func (*Pagerduty) SendAlert added in v1.18.0

func (pd *Pagerduty) SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error

func (*Pagerduty) SendDeployment added in v1.10.0

func (pd *Pagerduty) SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error

func (*Pagerduty) SendIncident

func (pd *Pagerduty) SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error

type Slack

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

func NewSlack

func NewSlack(token, channel string) *Slack

func (*Slack) SendAlert added in v1.18.0

func (s *Slack) SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error

func (*Slack) SendDeployment

func (s *Slack) SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error

func (*Slack) SendIncident

func (s *Slack) SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error

type Teams

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

func NewTeams

func NewTeams(webhookUrl string) *Teams

func (*Teams) SendAlert added in v1.18.0

func (t *Teams) SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error

func (*Teams) SendDeployment

func (t *Teams) SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error

func (*Teams) SendIncident

func (t *Teams) SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error

type Webhook added in v1.0.0

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

func NewWebhook added in v1.0.0

func NewWebhook(cfg *db.IntegrationWebhook) *Webhook

func (*Webhook) SendAlert added in v1.18.0

func (wh *Webhook) SendAlert(ctx context.Context, baseUrl string, n *db.AlertNotification) error

func (*Webhook) SendDeployment added in v1.0.0

func (wh *Webhook) SendDeployment(ctx context.Context, project *db.Project, ds model.ApplicationDeploymentStatus) error

func (*Webhook) SendIncident added in v1.0.0

func (wh *Webhook) SendIncident(ctx context.Context, baseUrl string, n *db.IncidentNotification) error

Jump to

Keyboard shortcuts

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