Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a client for the prometheus remote write API. It is safe to be shared between goroutines.
func NewClient ¶
func NewClient(opts ClientOpts) (*Client, error)
func (*Client) CloseIdleConnections ¶
func (c *Client) CloseIdleConnections()
type ClientOpts ¶
type ClientOpts struct {
// Close controls whether the client closes the connection after each request.
Close bool
// Timeout is the timeout for the http client and the http request.
Timeout time.Duration
// InsecureSkipVerify controls whether the client verifies the server's certificate chain and host name.
InsecureSkipVerify bool
// IdleConnTimeout is the maximum amount of time an idle (keep-alive) connection
// will remain idle before closing itself.
IdleConnTimeout time.Duration
// ResponseHeaderTimeout is the amount of time to wait for a server's response headers
// after fully writing the request (including its body, if any).
ResponseHeaderTimeout time.Duration
// MaxIdleConns controls the maximum number of idle (keep-alive) connections across all hosts.
MaxIdleConns int
// MaxIdleConnsPerHost, if non-zero, controls the maximum idle (keep-alive) per host.
MaxIdleConnsPerHost int
// MaxConnsPerHost, if non-zero, controls the maximum connections per host.
MaxConnsPerHost int
// TLSHandshakeTimeout specifies the maximum amount of time to
// wait for a TLS handshake. Zero means no timeout.
TLSHandshakeTimeout time.Duration
// DisableHTTP2 controls whether the client disables HTTP/2 support.
DisableHTTP2 bool
// DisableKeepAlives controls whether the client disables HTTP keep-alives.
DisableKeepAlives bool
// Endpoint for writing to the prometheus remote write API.
Endpoint string
}
func (ClientOpts) WithDefaults ¶
func (c ClientOpts) WithDefaults() ClientOpts
type RemoteWriteProxy ¶
type RemoteWriteProxy struct {
// contains filtered or unexported fields
}
func NewRemoteWriteProxy ¶
func NewRemoteWriteProxy(clients []remote.RemoteWriteClient, maxBatchSize int, disableMetricsForwarding bool) *RemoteWriteProxy
func (*RemoteWriteProxy) Close ¶
func (r *RemoteWriteProxy) Close() error
func (*RemoteWriteProxy) Write ¶
func (r *RemoteWriteProxy) Write(ctx context.Context, wr *prompb.WriteRequest) error
Click to show internal directories.
Click to hide internal directories.