Documentation ¶
Index ¶
- func FromContext(ctx context.Context) string
- func NewContext(ctx context.Context, tenantId string) context.Context
- type AlertManagerConfig
- type Client
- func (c *Client) CreateAlertmanagerConfig(amConfigs AlertManagerConfig, tenantID string) error
- func (c *Client) CreateRuleGroup(ctx context.Context, namespace string, rg rwrulefmt.RuleGroup) error
- func (c *Client) DeleteRuleGroup(ctx context.Context, namespace, groupName string) error
- func (c *Client) GetRuleGroup(ctx context.Context, namespace, groupName string) (*rwrulefmt.RuleGroup, error)
- func (c *Client) ListRules(ctx context.Context, namespace string) (map[string][]rwrulefmt.RuleGroup, error)
- type ClientOption
- type Config
- type CortexCaller
- type ReceiverConfig
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromContext ¶
FromContext returns the tenant ID from the context if present, and empty otherwise.
Types ¶
type AlertManagerConfig ¶
type AlertManagerConfig struct {
Receivers []ReceiverConfig
}
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) CreateAlertmanagerConfig ¶
func (c *Client) CreateAlertmanagerConfig(amConfigs AlertManagerConfig, tenantID string) error
CreateAlertmanagerConfig uploads an alert manager config to cortex
func (*Client) CreateRuleGroup ¶
func (*Client) DeleteRuleGroup ¶
func (*Client) GetRuleGroup ¶
type ClientOption ¶
type ClientOption func(*Client)
func WithCortexClient ¶
func WithCortexClient(cc CortexCaller) ClientOption
WithCortexClient uses cortex client passed in the argument
func WithHelperTemplate ¶
func WithHelperTemplate(configYaml, helperTemplate string) ClientOption
WithHelperTemplate assigns helper template and configYaml string
type CortexCaller ¶
type CortexCaller interface { CreateAlertmanagerConfig(ctx context.Context, cfg string, templates map[string]string) error CreateRuleGroup(ctx context.Context, namespace string, rg rwrulefmt.RuleGroup) error DeleteRuleGroup(ctx context.Context, namespace, groupName string) error GetRuleGroup(ctx context.Context, namespace, groupName string) (*rwrulefmt.RuleGroup, error) ListRules(ctx context.Context, namespace string) (map[string][]rwrulefmt.RuleGroup, error) }
Click to show internal directories.
Click to hide internal directories.