remotewrite

package
v1.39.2 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

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 an asynchronous HTTP client for writing timeseries via remote write protocol.

func Init added in v1.37.4

func Init(ctx context.Context) (*Client, error)

Init creates Client object from given flags. Returns nil if addr flag wasn't set.

func NewClient

func NewClient(ctx context.Context, cfg Config) (*Client, error)

NewClient returns asynchronous client for writing timeseries via remotewrite protocol.

func (*Client) Close

func (c *Client) Close() error

Close stops the client and waits for all goroutines to exit.

func (*Client) Push

func (c *Client) Push(s prompbmarshal.TimeSeries) error

Push adds timeseries into queue for writing into remote storage. Push returns and error if client is stopped or if queue is full.

type Config

type Config struct {
	// Addr of remote storage
	Addr string

	BasicAuthUser string
	BasicAuthPass string

	// Concurrency defines number of readers that
	// concurrently read from the queue and flush data
	Concurrency int
	// MaxBatchSize defines max number of timeseries
	// to be flushed at once
	MaxBatchSize int
	// MaxQueueSize defines max length of input queue
	// populated by Push method.
	// Push will be rejected once queue is full.
	MaxQueueSize int
	// FlushInterval defines time interval for flushing batches
	FlushInterval time.Duration
	// WriteTimeout defines timeout for HTTP write request
	// to remote storage
	WriteTimeout time.Duration
	// Transport will be used by the underlying http.Client
	Transport *http.Transport
}

Config is config for remote write.

Jump to

Keyboard shortcuts

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