remote

package
v1.7.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2017 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Overview

Package remote is a generated protocol buffer package.

It is generated from these files:

remote.proto

It has these top-level messages:

Sample
LabelPair
TimeSeries
WriteRequest
ReadRequest
ReadResponse
Query
LabelMatcher
QueryResult

Index

Constants

This section is empty.

Variables

View Source
var MatchType_name = map[int32]string{
	0: "EQUAL",
	1: "NOT_EQUAL",
	2: "REGEX_MATCH",
	3: "REGEX_NO_MATCH",
}
View Source
var MatchType_value = map[string]int32{
	"EQUAL":          0,
	"NOT_EQUAL":      1,
	"REGEX_MATCH":    2,
	"REGEX_NO_MATCH": 3,
}

Functions

func MatrixToIterators added in v1.6.0

func MatrixToIterators(m model.Matrix, err error) ([]local.SeriesIterator, error)

MatrixToIterators returns series iterators for a given matrix.

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 model.Time, matchers metric.LabelMatchers) (model.Matrix, 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 LabelMatcher added in v1.6.0

type LabelMatcher struct {
	Type  MatchType `protobuf:"varint,1,opt,name=type,enum=remote.MatchType" json:"type,omitempty"`
	Name  string    `protobuf:"bytes,2,opt,name=name" json:"name,omitempty"`
	Value string    `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"`
}

func (*LabelMatcher) Descriptor added in v1.6.0

func (*LabelMatcher) Descriptor() ([]byte, []int)

func (*LabelMatcher) GetName added in v1.6.0

func (m *LabelMatcher) GetName() string

func (*LabelMatcher) GetType added in v1.6.0

func (m *LabelMatcher) GetType() MatchType

func (*LabelMatcher) GetValue added in v1.6.0

func (m *LabelMatcher) GetValue() string

func (*LabelMatcher) ProtoMessage added in v1.6.0

func (*LabelMatcher) ProtoMessage()

func (*LabelMatcher) Reset added in v1.6.0

func (m *LabelMatcher) Reset()

func (*LabelMatcher) String added in v1.6.0

func (m *LabelMatcher) String() string

type LabelPair added in v1.1.0

type LabelPair struct {
	Name  string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
	Value string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"`
}

func (*LabelPair) Descriptor added in v1.1.0

func (*LabelPair) Descriptor() ([]byte, []int)

func (*LabelPair) GetName added in v1.6.0

func (m *LabelPair) GetName() string

func (*LabelPair) GetValue added in v1.6.0

func (m *LabelPair) GetValue() string

func (*LabelPair) ProtoMessage added in v1.1.0

func (*LabelPair) ProtoMessage()

func (*LabelPair) Reset added in v1.1.0

func (m *LabelPair) Reset()

func (*LabelPair) String added in v1.1.0

func (m *LabelPair) String() string

type MatchType added in v1.6.0

type MatchType int32
const (
	MatchType_EQUAL          MatchType = 0
	MatchType_NOT_EQUAL      MatchType = 1
	MatchType_REGEX_MATCH    MatchType = 2
	MatchType_REGEX_NO_MATCH MatchType = 3
)

func (MatchType) EnumDescriptor added in v1.6.0

func (MatchType) EnumDescriptor() ([]byte, []int)

func (MatchType) String added in v1.6.0

func (x MatchType) String() string

type Query added in v1.6.0

type Query struct {
	StartTimestampMs int64           `protobuf:"varint,1,opt,name=start_timestamp_ms,json=startTimestampMs" json:"start_timestamp_ms,omitempty"`
	EndTimestampMs   int64           `protobuf:"varint,2,opt,name=end_timestamp_ms,json=endTimestampMs" json:"end_timestamp_ms,omitempty"`
	Matchers         []*LabelMatcher `protobuf:"bytes,3,rep,name=matchers" json:"matchers,omitempty"`
}

func (*Query) Descriptor added in v1.6.0

func (*Query) Descriptor() ([]byte, []int)

func (*Query) GetEndTimestampMs added in v1.6.0

func (m *Query) GetEndTimestampMs() int64

func (*Query) GetMatchers added in v1.6.0

func (m *Query) GetMatchers() []*LabelMatcher

func (*Query) GetStartTimestampMs added in v1.6.0

func (m *Query) GetStartTimestampMs() int64

func (*Query) ProtoMessage added in v1.6.0

func (*Query) ProtoMessage()

func (*Query) Reset added in v1.6.0

func (m *Query) Reset()

func (*Query) String added in v1.6.0

func (m *Query) String() string

type QueryResult added in v1.6.0

type QueryResult struct {
	Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries" json:"timeseries,omitempty"`
}

func (*QueryResult) Descriptor added in v1.6.0

func (*QueryResult) Descriptor() ([]byte, []int)

func (*QueryResult) GetTimeseries added in v1.6.0

func (m *QueryResult) GetTimeseries() []*TimeSeries

func (*QueryResult) ProtoMessage added in v1.6.0

func (*QueryResult) ProtoMessage()

func (*QueryResult) Reset added in v1.6.0

func (m *QueryResult) Reset()

func (*QueryResult) String added in v1.6.0

func (m *QueryResult) String() string

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 ReadRequest added in v1.6.0

type ReadRequest struct {
	Queries []*Query `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"`
}

func (*ReadRequest) Descriptor added in v1.6.0

func (*ReadRequest) Descriptor() ([]byte, []int)

func (*ReadRequest) GetQueries added in v1.6.0

func (m *ReadRequest) GetQueries() []*Query

func (*ReadRequest) ProtoMessage added in v1.6.0

func (*ReadRequest) ProtoMessage()

func (*ReadRequest) Reset added in v1.6.0

func (m *ReadRequest) Reset()

func (*ReadRequest) String added in v1.6.0

func (m *ReadRequest) String() string

type ReadResponse added in v1.6.0

type ReadResponse struct {
	// In same order as the request's queries.
	Results []*QueryResult `protobuf:"bytes,1,rep,name=results" json:"results,omitempty"`
}

func (*ReadResponse) Descriptor added in v1.6.0

func (*ReadResponse) Descriptor() ([]byte, []int)

func (*ReadResponse) GetResults added in v1.6.0

func (m *ReadResponse) GetResults() []*QueryResult

func (*ReadResponse) ProtoMessage added in v1.6.0

func (*ReadResponse) ProtoMessage()

func (*ReadResponse) Reset added in v1.6.0

func (m *ReadResponse) Reset()

func (*ReadResponse) String added in v1.6.0

func (m *ReadResponse) String() string

type Reader added in v1.6.0

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

Reader allows reading from multiple remote sources.

func (*Reader) ApplyConfig added in v1.6.0

func (r *Reader) ApplyConfig(conf *config.Config) error

ApplyConfig updates the state as the new config requires.

func (*Reader) Queriers added in v1.6.0

func (r *Reader) Queriers() []local.Querier

Queriers returns a list of Queriers for the currently configured remote read endpoints.

type Sample added in v1.1.0

type Sample struct {
	Value       float64 `protobuf:"fixed64,1,opt,name=value" json:"value,omitempty"`
	TimestampMs int64   `protobuf:"varint,2,opt,name=timestamp_ms,json=timestampMs" json:"timestamp_ms,omitempty"`
}

func (*Sample) Descriptor added in v1.1.0

func (*Sample) Descriptor() ([]byte, []int)

func (*Sample) GetTimestampMs added in v1.6.0

func (m *Sample) GetTimestampMs() int64

func (*Sample) GetValue added in v1.6.0

func (m *Sample) GetValue() float64

func (*Sample) ProtoMessage added in v1.1.0

func (*Sample) ProtoMessage()

func (*Sample) Reset added in v1.1.0

func (m *Sample) Reset()

func (*Sample) String added in v1.1.0

func (m *Sample) String() string

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.

type TimeSeries added in v1.1.0

type TimeSeries struct {
	Labels []*LabelPair `protobuf:"bytes,1,rep,name=labels" json:"labels,omitempty"`
	// Sorted by time, oldest sample first.
	Samples []*Sample `protobuf:"bytes,2,rep,name=samples" json:"samples,omitempty"`
}

func (*TimeSeries) Descriptor added in v1.1.0

func (*TimeSeries) Descriptor() ([]byte, []int)

func (*TimeSeries) GetLabels added in v1.1.0

func (m *TimeSeries) GetLabels() []*LabelPair

func (*TimeSeries) GetSamples added in v1.1.0

func (m *TimeSeries) GetSamples() []*Sample

func (*TimeSeries) ProtoMessage added in v1.1.0

func (*TimeSeries) ProtoMessage()

func (*TimeSeries) Reset added in v1.1.0

func (m *TimeSeries) Reset()

func (*TimeSeries) String added in v1.1.0

func (m *TimeSeries) String() string

type WriteRequest added in v1.1.0

type WriteRequest struct {
	Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries" json:"timeseries,omitempty"`
}

func (*WriteRequest) Descriptor added in v1.1.0

func (*WriteRequest) Descriptor() ([]byte, []int)

func (*WriteRequest) GetTimeseries added in v1.1.0

func (m *WriteRequest) GetTimeseries() []*TimeSeries

func (*WriteRequest) ProtoMessage added in v1.1.0

func (*WriteRequest) ProtoMessage()

func (*WriteRequest) Reset added in v1.1.0

func (m *WriteRequest) Reset()

func (*WriteRequest) String added in v1.1.0

func (m *WriteRequest) String() string

type Writer added in v1.6.0

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

Writer allows queueing samples for remote writes.

func (*Writer) Append added in v1.6.0

func (w *Writer) Append(smpl *model.Sample) error

Append implements storage.SampleAppender. Always returns nil.

func (*Writer) ApplyConfig added in v1.6.0

func (w *Writer) ApplyConfig(conf *config.Config) error

ApplyConfig updates the state as the new config requires.

func (*Writer) NeedsThrottling added in v1.6.0

func (w *Writer) 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 (*Writer) Stop added in v1.6.0

func (w *Writer) Stop()

Stop the background processing of the storage queues.

Jump to

Keyboard shortcuts

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