remote

package
v0.0.0-...-6d17679 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 16, 2023 License: AGPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package remote implements the Prometheus remote write protocol.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BasicAuth

type BasicAuth struct {
	Username, Password string
}

BasicAuth holds the config for basic authentication.

type HTTPConfig

type HTTPConfig struct {
	Timeout   time.Duration
	TLSConfig *tls.Config
	BasicAuth *BasicAuth
	Headers   http.Header
}

HTTPConfig holds the config for the HTTP client.

type WriteClient

type WriteClient struct {
	// contains filtered or unexported fields
}

WriteClient is a client implementation of the Prometheus remote write protocol. It follows the specs defined by the official design document: https://docs.google.com/document/d/1LPhVRSFkGNSuU1fBd81ulhsCPR4hkSZyyBj1SZ8fWOM

func NewWriteClient

func NewWriteClient(endpoint string, cfg *HTTPConfig) (*WriteClient, error)

NewWriteClient creates a new WriteClient.

func (*WriteClient) Store

func (c *WriteClient) Store(ctx context.Context, series []*prompb.TimeSeries) error

Store sends a batch of samples to the HTTP endpoint, the request is the proto marshaled and encoded.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL