Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AlertStore ¶ added in v0.7.0
type AlertStore interface {
ListAlertConfigs(ctx context.Context) (map[string]alerts.AlertConfigDesc, error)
}
AlertStore stores and configures users rule configs
func NewAlertStore ¶ added in v0.7.0
func NewAlertStore(cfg AlertStoreConfig) (AlertStore, error)
NewAlertStore returns a new rule storage backend poller and store
type AlertStoreConfig ¶ added in v0.7.0
type AlertStoreConfig struct {
Type string `yaml:"type"`
ConfigDB client.Config `yaml:"configdb"`
Local local.StoreConfig `yaml:"local"`
}
AlertStoreConfig configures the alertmanager backend
func (*AlertStoreConfig) RegisterFlags ¶ added in v0.7.0
func (cfg *AlertStoreConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers flags.
type Alertmanager ¶
type Alertmanager struct {
// contains filtered or unexported fields
}
An Alertmanager manages the alerts for one user.
func New ¶
func New(cfg *Config, reg *prometheus.Registry) (*Alertmanager, error)
New creates a new Alertmanager.
func (*Alertmanager) ApplyConfig ¶
func (am *Alertmanager) ApplyConfig(userID string, conf *config.Config) error
ApplyConfig applies a new configuration to an Alertmanager.
func (*Alertmanager) IsActive ¶ added in v0.7.0
func (am *Alertmanager) IsActive() bool
IsActive returns if the alertmanager is currently running or is paused
func (*Alertmanager) Pause ¶ added in v0.7.0
func (am *Alertmanager) Pause()
Pause running jobs in the alertmanager that are able to be restarted and sets to inactives
type Config ¶
type Config struct {
UserID string
// Used to persist notification logs and silences on disk.
DataDir string
Logger log.Logger
Peer *cluster.Peer
PeerTimeout time.Duration
Retention time.Duration
ExternalURL *url.URL
}
Config configures an Alertmanager.
type MultitenantAlertmanager ¶
A MultitenantAlertmanager manages Alertmanager instances for multiple organizations.
func NewMultitenantAlertmanager ¶
func NewMultitenantAlertmanager(cfg *MultitenantAlertmanagerConfig, logger log.Logger, registerer prometheus.Registerer) (*MultitenantAlertmanager, error)
NewMultitenantAlertmanager creates a new MultitenantAlertmanager.
func (*MultitenantAlertmanager) GetStatusHandler ¶
func (am *MultitenantAlertmanager) GetStatusHandler() StatusHandler
GetStatusHandler returns the status handler for this multi-tenant alertmanager.
func (*MultitenantAlertmanager) ServeHTTP ¶
func (am *MultitenantAlertmanager) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP serves the Alertmanager's web UI and API.
type MultitenantAlertmanagerConfig ¶
type MultitenantAlertmanagerConfig struct {
DataDir string
Retention time.Duration
ExternalURL flagext.URLValue
PollInterval time.Duration
ClusterBindAddr string
ClusterAdvertiseAddr string
Peers flagext.StringSlice
PeerTimeout time.Duration
FallbackConfigFile string
AutoWebhookRoot string
Store AlertStoreConfig
}
MultitenantAlertmanagerConfig is the configuration for a multitenant Alertmanager.
func (*MultitenantAlertmanagerConfig) RegisterFlags ¶
func (cfg *MultitenantAlertmanagerConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.
type StatusHandler ¶
type StatusHandler struct {
// contains filtered or unexported fields
}
StatusHandler shows the status of the alertmanager.
func (StatusHandler) ServeHTTP ¶
func (s StatusHandler) ServeHTTP(w http.ResponseWriter, req *http.Request)
ServeHTTP serves the status of the alertmanager.