Documentation ¶
Index ¶
- type Client
- type QueueManager
- type QueueManagerConfig
- type Storage
- func (s *Storage) Add(l labels.Labels, t int64, v float64) (uint64, error)
- func (s *Storage) AddFast(l labels.Labels, _ uint64, t int64, v float64) error
- func (s *Storage) Appender() (storage.Appender, error)
- func (s *Storage) ApplyConfig(conf *config.Config) error
- func (s *Storage) Close() error
- func (*Storage) Commit() error
- func (r *Storage) Querier(mint, maxt int64) (storage.Querier, error)
- func (*Storage) Rollback() error
- type StorageClient
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.
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(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 (*Storage) ApplyConfig ¶
ApplyConfig updates the state as the new config requires.
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.