alertmanager

package
v1.0.8 Latest Latest
Warning

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

Go to latest
Published: Jan 2, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ElementKey = micro.ElementKey("AlertManagerComponent")

ElementKey is ElementKey for alert manager

Functions

func SetDefaultConfig

func SetDefaultConfig()

SetDefaultConfig -

Types

type Alert

type Alert struct {
	Labels      map[string]string `json:"labels"`
	Annotations map[string]string `json:"annotations"`
	StartsAt    time.Time         `json:"startsAt"`
	EndsAt      time.Time         `json:"endsAt"`
}

Alert -

type AlertManager

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

AlertManager -

func New

func New(config *Config, logger logging.ILogger) *AlertManager

New -

func (*AlertManager) Close

func (a *AlertManager) Close()

Close -

func (*AlertManager) InitWebhookHandler

func (a *AlertManager) InitWebhookHandler(h WebhookHandler)

InitWebhookHandler -

func (*AlertManager) Start

func (a *AlertManager) Start()

Start -

type Component

type Component struct {
	micro.EmptyComponent
	// contains filtered or unexported fields
}

Component is Component for alert manager

func (*Component) Init

func (c *Component) Init(server *micro.Server) error

Init the component

func (*Component) Name

func (c *Component) Name() string

Name of the component

func (*Component) PostStop

func (c *Component) PostStop(ctx context.Context) error

PostStop called after Stop()

func (*Component) PreInit

func (c *Component) PreInit(ctx context.Context) error

PreInit called before Init()

func (*Component) Start

func (c *Component) Start(ctx context.Context) error

Start the component

type Config

type Config struct {
	Enable        bool   `toml:"enable"`
	ServerAddress string `toml:"serveraddress"`
	ServerPort    int    `toml:"serverport"`
	URL           string `toml:"url"`
}

Config -

func GetConfig

func GetConfig() *Config

GetConfig -

type Notification

type Notification struct {
	Version           string            `json:"version"`
	GroupKey          string            `json:"groupKey"`
	Status            string            `json:"status"`
	Receiver          string            `json:"receiver"`
	GroupLabels       map[string]string `json:"groupLabels"`
	CommonLabels      map[string]string `json:"commonLabels"`
	CommonAnnotations map[string]string `json:"commonAnnotations"`
	ExternalURL       string            `json:"externalURL"`
	Alerts            []Alert           `json:"alerts"`
}

Notification -

type WebhookHandler

type WebhookHandler interface {
	RegisterWebhookHandler(c echo.Context) error
}

WebhookHandler is an interface that wraps the initWebhookHandler method

Jump to

Keyboard shortcuts

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