remotewrite

package
v1.100.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 19 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 client.

type DebugClient added in v1.92.0

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

DebugClient won't push series periodically, but will write data to remote endpoint immediately when Push() is called

func NewDebugClient added in v1.92.0

func NewDebugClient() (*DebugClient, error)

NewDebugClient initiates and returns a new DebugClient

func (*DebugClient) Close added in v1.92.0

func (c *DebugClient) Close() error

Close stops the DebugClient

func (*DebugClient) Push added in v1.92.0

Push sends the given timeseries to the remote storage.

type RWClient added in v1.92.0

type RWClient interface {
	// Push pushes the give time series to remote storage
	Push(s prompbmarshal.TimeSeries) error
	// Close stops the client. Client can't be reused after Close call.
	Close() error
}

RWClient represents an HTTP client for pushing data via remote write protocol

Jump to

Keyboard shortcuts

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