Documentation
¶
Overview ¶
Package alertmanager provides a client for configuring and managing Alertmanager tenants on a Mimir instance.
It implements the Service interface which exposes two operations:
- [Service.ConfigureFromSecret]: validate and push an Alertmanager configuration stored in a Kubernetes Secret to Mimir.
- [Service.DeleteForTenant]: remove the Alertmanager configuration for a given tenant from Mimir (idempotent).
The Validate function provides lightweight config+template validation for use in admission webhooks without making any HTTP calls.
Index ¶
Constants ¶
View Source
const ( // 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" // AlertmanagerConfigFinalizer is the finalizer added to Alertmanager config secrets. // It ensures the config is deleted from Mimir before the secret is garbage collected. AlertmanagerConfigFinalizer = "observability.giantswarm.io/alertmanager-config" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIError ¶
APIError represents an error response from the Mimir Alertmanager API, capturing the HTTP status code and response body for diagnostics.
type Service ¶
type Service interface {
// ConfigureFromSecret pushes the Alertmanager configuration stored in secret to Mimir for the given tenant.
ConfigureFromSecret(ctx context.Context, secret *v1.Secret, tenantID string) error
// DeleteForTenant removes the Alertmanager configuration for the given tenant from Mimir.
// It is idempotent: if no configuration exists, it returns nil.
DeleteForTenant(ctx context.Context, tenantID string) error
}
Service is the interface for configuring Alertmanager.
Click to show internal directories.
Click to hide internal directories.