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 Prometheus Remote Write client.
func NewClient ¶
func NewClient(endpoint string, options ...ClientOption) *Client
func (*Client) Write ¶
func (p *Client) Write(ctx context.Context, req *WriteRequest, options ...WriteOption) (*WriteResponse, error)
Write sends HTTP requests to Prometheus Remote Write compatible API endpoint including Prometheus, Cortex and VictoriaMetrics.
type ClientOption ¶
type ClientOption func(opts *clientOptions)
ClientOption is used to set custom client options.
func HttpClient ¶
func HttpClient(client *http.Client) ClientOption
HttpClient option allows configuring custom HTTP client.
type TimeSeries ¶
type WriteError ¶
type WriteError struct {
// contains filtered or unexported fields
}
WriteError returned if HTTP call is finished with response status code, but it was not successful.
func (*WriteError) Error ¶
func (e *WriteError) Error() string
func (*WriteError) StatusCode ¶
func (e *WriteError) StatusCode() int
type WriteOption ¶
type WriteOption func(opts *writeOptions)
func WriteHeaders ¶
func WriteHeaders(headers map[string]string) WriteOption
WriteHeaders allows passing custom HTTP headers. Once common use case is to pass `X-Scope-OrgID` header for Cortex tenant.
type WriteRequest ¶
type WriteRequest struct {
TimeSeries []TimeSeries
}
type WriteResponse ¶
type WriteResponse struct { }
Click to show internal directories.
Click to hide internal directories.