alertmanager

package
v0.51.1 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Those values are used to retrieve the Alertmanager configuration from the secret named after conf.Monitoring.AlertmanagerSecretName
	// AlertmanagerConfigKey is the key to the alertmanager configuration in the secret
	AlertmanagerConfigKey = "alertmanager.yaml"
	// TemplatesSuffix is the suffix used to identify the templates in the secret
	TemplatesSuffix = ".tmpl"
)

Variables

This section is empty.

Functions

func ExtractAlertmanagerConfig added in v0.26.0

func ExtractAlertmanagerConfig(secret *v1.Secret) ([]byte, error)

ExtractAlertmanagerConfig extracts the raw config bytes.

func ParseAlertmanagerConfig added in v0.51.0

func ParseAlertmanagerConfig(alertmanagerConfig []byte) (*config.Config, error)

Types

type APIError

type APIError struct {
	Code    int
	Message string
}

func (APIError) Error

func (e APIError) Error() string

type Service

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

func New

func New(cfg pkgconfig.Config) Service

func (Service) Configure

func (s Service) Configure(ctx context.Context, alertmanagerConfigContent []byte, templates map[string]string, tenantID string) error

Configure sends the configuration and templates to Mimir Alertmanager's API It is the caller responsibility to make sure templates names are valid (do not contain any path), and that templates are referenced in the configuration. https://grafana.com/docs/mimir/latest/references/http-api/#set-alertmanager-configuration

func (Service) ConfigureFromSecret added in v0.50.0

func (s Service) ConfigureFromSecret(ctx context.Context, secret *v1.Secret, tenantID string) error

Jump to

Keyboard shortcuts

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