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) Clone() AlertingClient
- func (c *Client) ConfigClient() ConfigClient
- 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) 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) ProxyURL() *url.URL
- 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 ClientOption
- type ClientOptions
- type ConfigClient
- type ControlClient
- type MemberlistClient
- type ProxyClient
- type QueryClient
- type SilenceClient
- type StatusClient
- type TLSClientConfig
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 { MemberlistClient() MemberlistClient ControlClient() ControlClient StatusClient() StatusClient ConfigClient() ConfigClient AlertClient() AlertClient QueryClient() QueryClient SilenceClient() SilenceClient ProxyClient() ProxyClient Clone() AlertingClient }
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 ¶
type Client struct { *ClientOptions // contains filtered or unexported fields }
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 NewClient ¶
func NewClient( opts ...ClientOption, ) (*Client, error)
func (*Client) AlertClient ¶
func (c *Client) AlertClient() AlertClient
func (*Client) Clone ¶ added in v0.12.0
func (c *Client) Clone() AlertingClient
func (*Client) ConfigClient ¶
func (c *Client) ConfigClient() ConfigClient
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 ClientOption ¶ added in v0.12.0
type ClientOption func(*ClientOptions)
func WithAlertManagerAddress ¶ added in v0.12.0
func WithAlertManagerAddress(addr string) ClientOption
func WithProxyAddress ¶ added in v0.12.0
func WithProxyAddress(addr string) ClientOption
func WithProxyHttpClient ¶ added in v0.12.0
func WithProxyHttpClient(client http.Client) ClientOption
func WithQuerierAddress ¶ added in v0.12.0
func WithQuerierAddress(addr string) ClientOption
func WithTLSConfig ¶ added in v0.12.0
func WithTLSConfig(config *tls.Config) ClientOption
type ClientOptions ¶ added in v0.12.0
type ClientOptions struct {
// contains filtered or unexported fields
}
func DefaultOptions ¶ added in v0.12.0
func DefaultOptions() *ClientOptions
func (*ClientOptions) Apply ¶ added in v0.12.0
func (o *ClientOptions) Apply(opts ...ClientOption)
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 }
type TLSClientConfig ¶ added in v0.12.0
type TLSClientConfig struct { // Path to the server CA certificate. ServerCA string // Path to the client CA certificate (not needed in all cases). ClientCA string // Path to the certificate used for client-cert auth. ClientCert string // Path to the private key used for client-cert auth. ClientKey string }
Click to show internal directories.
Click to hide internal directories.