remote

package
v2.0.0-rc.2+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2017 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client added in v1.1.0

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

Client allows reading and writing from/to a remote HTTP endpoint.

func NewClient added in v1.1.0

func NewClient(index int, conf *clientConfig) (*Client, error)

NewClient creates a new Client.

func (Client) Name added in v1.1.0

func (c Client) Name() string

Name identifies the client.

func (*Client) Read added in v1.6.0

func (c *Client) Read(ctx context.Context, from, through int64, matchers []*prompb.LabelMatcher) ([]*prompb.TimeSeries, error)

Read reads from a remote endpoint.

func (*Client) Store added in v1.1.0

func (c *Client) Store(samples model.Samples) error

Store sends a batch of samples to the HTTP endpoint.

type QueueManager added in v1.6.0

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

QueueManager manages a queue of samples to be sent to the Storage indicated by the provided StorageClient.

func NewQueueManager added in v1.6.0

func NewQueueManager(logger log.Logger, cfg QueueManagerConfig, externalLabels model.LabelSet, relabelConfigs []*config.RelabelConfig, client StorageClient) *QueueManager

NewQueueManager builds a new QueueManager.

func (*QueueManager) Append added in v1.6.0

func (t *QueueManager) Append(s *model.Sample) error

Append queues a sample to be sent to the remote storage. It drops the sample on the floor if the queue is full. Always returns nil.

func (*QueueManager) NeedsThrottling added in v1.6.0

func (*QueueManager) NeedsThrottling() bool

NeedsThrottling implements storage.SampleAppender. It will always return false as a remote storage drops samples on the floor if backlogging instead of asking for throttling.

func (*QueueManager) Start added in v1.6.0

func (t *QueueManager) Start()

Start the queue manager sending samples to the remote storage. Does not block.

func (*QueueManager) Stop added in v1.6.0

func (t *QueueManager) Stop()

Stop stops sending samples to the remote storage and waits for pending sends to complete.

type QueueManagerConfig added in v1.6.0

type QueueManagerConfig struct {
	// Number of samples to buffer per shard before we start dropping them.
	QueueCapacity int
	// Max number of shards, i.e. amount of concurrency.
	MaxShards int
	// Maximum number of samples per send.
	MaxSamplesPerSend int
	// Maximum time sample will wait in buffer.
	BatchSendDeadline time.Duration
	// Max number of times to retry a batch on recoverable errors.
	MaxRetries int
	// On recoverable errors, backoff exponentially.
	MinBackoff time.Duration
	MaxBackoff time.Duration
}

QueueManagerConfig is the configuration for the queue used to write to remote storage.

type Storage

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

Storage represents all the remote read and write endpoints. It implements storage.Storage.

func NewStorage

func NewStorage(l log.Logger, stCallback startTimeCallback) *Storage

NewStorage returns a remote.Storage.

func (*Storage) Add

func (s *Storage) Add(l labels.Labels, t int64, v float64) (uint64, error)

Add implements storage.Appender.

func (*Storage) AddFast

func (s *Storage) AddFast(l labels.Labels, _ uint64, t int64, v float64) error

AddFast implements storage.Appender.

func (*Storage) Appender

func (s *Storage) Appender() (storage.Appender, error)

Appender implements retrieval.Appendable.

func (*Storage) ApplyConfig

func (s *Storage) ApplyConfig(conf *config.Config) error

ApplyConfig updates the state as the new config requires.

func (*Storage) Close

func (s *Storage) Close() error

Close the background processing of the storage queues.

func (*Storage) Commit

func (*Storage) Commit() error

Commit implements storage.Appender.

func (*Storage) Querier

func (r *Storage) Querier(_ context.Context, mint, maxt int64) (storage.Querier, error)

Querier returns a new Querier on the storage.

func (*Storage) Rollback

func (*Storage) Rollback() error

Rollback implements storage.Appender.

func (*Storage) StartTime

func (s *Storage) StartTime() (int64, error)

StartTime implements the Storage interface.

type StorageClient

type StorageClient interface {
	// Store stores the given samples in the remote storage.
	Store(model.Samples) error
	// Name identifies the remote storage implementation.
	Name() string
}

StorageClient defines an interface for sending a batch of samples to an external timeseries database.

Jump to

Keyboard shortcuts

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