remotewrite

package
v1.87.9 Latest Latest
Warning

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

Go to latest
Published: Sep 10, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func InitSecretFlags added in v1.79.3

func InitSecretFlags()

InitSecretFlags must be called after flag.Parse and before any logging

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
	AuthCfg *promauth.Config

	// 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
	// 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