Documentation ¶
Index ¶
- func AtMostOne[Resp any](ctx context.Context, client *http.Client, reqs []*http.Request) (*Resp, error)
- func ToOpenApiTime(t time.Time) strfmt.DateTime
- type AlertClient
- type AlertObject
- type AlertingClient
- type AlertingPeer
- type Client
- func (c *Client) AlertClient() AlertClient
- func (c *Client) ConfigClient() ConfigClient
- func (c *Client) ConfigureHttp(mutateFn func(*http.Client))
- func (c *Client) ControlClient() ControlClient
- func (c *Client) DeleteSilence(ctx context.Context, silenceId string) error
- func (c *Client) GetAlert(ctx context.Context, matchLabels []*labels.Matcher) (alertmanagerv2.GettableAlerts, error)
- func (c *Client) GetReceiver(ctx context.Context, id string) (alertmanagerv2.Receiver, error)
- func (c *Client) GetSilence(ctx context.Context, matchers labels.Matchers) (alertmanagerv2.GettableSilences, error)
- func (c *Client) Handle(ctx context.Context, req *http.Request) (*http.Response, error)
- func (c *Client) ListAlarmMessages(ctx context.Context, listReq *alertingv1.ListAlarmMessageRequest) (*alertingv1.ListMessageResponse, error)
- func (c *Client) ListAlerts(ctx context.Context) (alertmanagerv2.AlertGroups, error)
- func (c *Client) ListNotificationMessages(ctx context.Context, listReq *alertingv1.ListNotificationRequest) (*alertingv1.ListMessageResponse, error)
- func (c *Client) ListReceivers(ctx context.Context) (recvs []alertmanagerv2.Receiver, err error)
- func (c *Client) ListSilences(ctx context.Context) (alertmanagerv2.GettableSilences, error)
- func (c *Client) MemberPeers() []AlertingPeer
- func (c *Client) MemberlistClient() MemberlistClient
- func (c *Client) PostAlarm(ctx context.Context, alarm AlertObject) error
- func (c *Client) PostNotification(ctx context.Context, notification AlertObject) error
- func (c *Client) PostSilence(ctx context.Context, alertingObjectId string, dur time.Duration, ...) (silenceId string, err error)
- func (c *Client) ProxyClient() ProxyClient
- func (c *Client) QueryClient() QueryClient
- func (c *Client) Ready(ctx context.Context) error
- func (c *Client) Reload(ctx context.Context) error
- func (c *Client) ResolveAlert(ctx context.Context, alertObject AlertObject) error
- func (c *Client) SetKnownPeers(peers []AlertingPeer)
- func (c *Client) SilenceClient() SilenceClient
- func (c *Client) Status(ctx context.Context) ([]alertmanagerv2.AlertmanagerStatus, error)
- func (c *Client) StatusClient() StatusClient
- type ConfigClient
- type ControlClient
- type MemberlistClient
- type ProxyClient
- type QueryClient
- type SilenceClient
- type StatusClient
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AlertClient ¶
type AlertClient interface { ListAlerts(ctx context.Context) (alertmanagerv2.AlertGroups, error) GetAlert(ctx context.Context, labels []*labels.Matcher) (alertmanagerv2.GettableAlerts, error) PostAlarm(ctx context.Context, obj AlertObject) error PostNotification(ctx context.Context, obj AlertObject) error ResolveAlert(ctx context.Context, obj AlertObject) error }
type AlertObject ¶
func (*AlertObject) Validate ¶
func (a *AlertObject) Validate() error
type AlertingClient ¶
type AlertingClient interface { ConfigureHttp(mutateFn func(*http.Client)) MemberlistClient() MemberlistClient ControlClient() ControlClient StatusClient() StatusClient ConfigClient() ConfigClient AlertClient() AlertClient QueryClient() QueryClient SilenceClient() SilenceClient ProxyClient() ProxyClient }
A typical HA setup of prometheus operator assumes that alert sources (in particular Prometheus), triggers api calls to all known peers and alert status & deduplication will be handled by its memberlisted nflog.
In our alerting client abstraction
type AlertingPeer ¶
type Client ¶
A typical HA setup of prometheus operator assumes that alert sources (in particular Prometheus), triggers api calls to all known peers and alert status & deduplication will be handled by its memberlisted nflog.
func (*Client) AlertClient ¶
func (c *Client) AlertClient() AlertClient
func (*Client) ConfigClient ¶
func (c *Client) ConfigClient() ConfigClient
func (*Client) ConfigureHttp ¶
func (*Client) ControlClient ¶
func (c *Client) ControlClient() ControlClient
func (*Client) DeleteSilence ¶
func (*Client) GetAlert ¶
func (c *Client) GetAlert(ctx context.Context, matchLabels []*labels.Matcher) (alertmanagerv2.GettableAlerts, error)
func (*Client) GetReceiver ¶
func (*Client) GetSilence ¶
func (c *Client) GetSilence(ctx context.Context, matchers labels.Matchers) (alertmanagerv2.GettableSilences, error)
func (*Client) ListAlarmMessages ¶
func (c *Client) ListAlarmMessages(ctx context.Context, listReq *alertingv1.ListAlarmMessageRequest) (*alertingv1.ListMessageResponse, error)
func (*Client) ListAlerts ¶
func (c *Client) ListAlerts(ctx context.Context) (alertmanagerv2.AlertGroups, error)
func (*Client) ListNotificationMessages ¶
func (c *Client) ListNotificationMessages( ctx context.Context, listReq *alertingv1.ListNotificationRequest, ) (*alertingv1.ListMessageResponse, error)
func (*Client) ListReceivers ¶
func (*Client) ListSilences ¶
func (c *Client) ListSilences(ctx context.Context) (alertmanagerv2.GettableSilences, error)
func (*Client) MemberPeers ¶
func (c *Client) MemberPeers() []AlertingPeer
func (*Client) MemberlistClient ¶
func (c *Client) MemberlistClient() MemberlistClient
func (*Client) PostAlarm ¶
func (c *Client) PostAlarm( ctx context.Context, alarm AlertObject, ) error
func (*Client) PostNotification ¶
func (c *Client) PostNotification( ctx context.Context, notification AlertObject, ) error
func (*Client) PostSilence ¶
func (*Client) ProxyClient ¶
func (c *Client) ProxyClient() ProxyClient
func (*Client) QueryClient ¶
func (c *Client) QueryClient() QueryClient
func (*Client) ResolveAlert ¶
func (c *Client) ResolveAlert(ctx context.Context, alertObject AlertObject) error
func (*Client) SetKnownPeers ¶
func (c *Client) SetKnownPeers(peers []AlertingPeer)
func (*Client) SilenceClient ¶
func (c *Client) SilenceClient() SilenceClient
func (*Client) Status ¶
func (c *Client) Status(ctx context.Context) ([]alertmanagerv2.AlertmanagerStatus, error)
func (*Client) StatusClient ¶
func (c *Client) StatusClient() StatusClient
type ConfigClient ¶
type ControlClient ¶
type MemberlistClient ¶
type MemberlistClient interface { MemberPeers() []AlertingPeer // Service Discovery for alerting api clients is delegated // to an external mechanism, such as cluster drivers SetKnownPeers(peers []AlertingPeer) }
type ProxyClient ¶
type QueryClient ¶
type QueryClient interface { ListAlarmMessages(context.Context, *alertingv1.ListAlarmMessageRequest) (*alertingv1.ListMessageResponse, error) ListNotificationMessages(context.Context, *alertingv1.ListNotificationRequest) (*alertingv1.ListMessageResponse, error) }
type SilenceClient ¶
type StatusClient ¶
type StatusClient interface { Status(ctx context.Context) ([]alertmanagerv2.AlertmanagerStatus, error) Ready(ctx context.Context) error }
Click to show internal directories.
Click to hide internal directories.