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 ¶
- Variables
 - func EncodeReadResponse(resp *ReadResponse, w http.ResponseWriter) error
 - func FromLabelPairs(labelPairs []*LabelPair) model.Metric
 - func FromQuery(req *Query) (model.Time, model.Time, []*metric.LabelMatcher, error)
 - func FromQueryResult(resp *QueryResult) model.Matrix
 - func IteratorsToMatrix(iters []local.SeriesIterator, interval metric.Interval) model.Matrix
 - func MatrixToIterators(m model.Matrix, err error) ([]local.SeriesIterator, error)
 - type Client
 - type ClientConfig
 - type LabelMatcher
 - type LabelPair
 - type MatchType
 - type Query
 - type QueryResult
 - type QueueManager
 - type ReadRequest
 - type ReadResponse
 - type Reader
 - type Sample
 - type StorageClient
 - type TimeSeries
 - type WriteRequest
 - type Writer
 
Constants ¶
This section is empty.
Variables ¶
var MatchType_name = map[int32]string{
	0: "EQUAL",
	1: "NOT_EQUAL",
	2: "REGEX_MATCH",
	3: "REGEX_NO_MATCH",
}
    var MatchType_value = map[string]int32{
	"EQUAL":          0,
	"NOT_EQUAL":      1,
	"REGEX_MATCH":    2,
	"REGEX_NO_MATCH": 3,
}
    Functions ¶
func EncodeReadResponse ¶
func EncodeReadResponse(resp *ReadResponse, w http.ResponseWriter) error
EncodeReadResponse writes a remote.Response to a http.ResponseWriter.
func FromLabelPairs ¶
FromLabelPairs unpack a []LabelPair to a model.Metric
func FromQueryResult ¶
func FromQueryResult(resp *QueryResult) model.Matrix
FromQueryResult unpacks a QueryResult proto.
func IteratorsToMatrix ¶
IteratorsToMatrix converts a list of iterators into a model.Matrix.
func MatrixToIterators ¶
MatrixToIterators returns series iterators for a given matrix.
Types ¶
type Client ¶
type Client struct {
	// contains filtered or unexported fields
}
    Client allows reading and writing from/to a remote HTTP endpoint.
func NewClient ¶
func NewClient(index int, conf *ClientConfig) (*Client, error)
NewClient creates a new Client.
type ClientConfig ¶
type ClientConfig struct {
	URL              *config.URL
	Timeout          model.Duration
	HTTPClientConfig config.HTTPClientConfig
}
    ClientConfig configures a Client.
type LabelMatcher ¶
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 ¶
func (*LabelMatcher) Descriptor() ([]byte, []int)
func (*LabelMatcher) GetName ¶
func (m *LabelMatcher) GetName() string
func (*LabelMatcher) GetType ¶
func (m *LabelMatcher) GetType() MatchType
func (*LabelMatcher) GetValue ¶
func (m *LabelMatcher) GetValue() string
func (*LabelMatcher) ProtoMessage ¶
func (*LabelMatcher) ProtoMessage()
func (*LabelMatcher) Reset ¶
func (m *LabelMatcher) Reset()
func (*LabelMatcher) String ¶
func (m *LabelMatcher) String() string
type LabelPair ¶
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 ToLabelPairs ¶
ToLabelPairs builds a []LabelPair from a model.Metric
func (*LabelPair) Descriptor ¶
func (*LabelPair) ProtoMessage ¶
func (*LabelPair) ProtoMessage()
type Query ¶
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 ¶
func (*Query) GetEndTimestampMs ¶
func (*Query) GetMatchers ¶
func (m *Query) GetMatchers() []*LabelMatcher
func (*Query) GetStartTimestampMs ¶
func (*Query) ProtoMessage ¶
func (*Query) ProtoMessage()
type QueryResult ¶
type QueryResult struct {
	Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries" json:"timeseries,omitempty"`
}
    func ToQueryResult ¶
func ToQueryResult(matrix model.Matrix) *QueryResult
ToQueryResult builds a QueryResult proto.
func (*QueryResult) Descriptor ¶
func (*QueryResult) Descriptor() ([]byte, []int)
func (*QueryResult) GetTimeseries ¶
func (m *QueryResult) GetTimeseries() []*TimeSeries
func (*QueryResult) ProtoMessage ¶
func (*QueryResult) ProtoMessage()
func (*QueryResult) Reset ¶
func (m *QueryResult) Reset()
func (*QueryResult) String ¶
func (m *QueryResult) String() string
type QueueManager ¶
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 ¶
func NewQueueManager(cfg config.QueueConfig, externalLabels model.LabelSet, relabelConfigs []*config.RelabelConfig, client StorageClient) *QueueManager
NewQueueManager builds a new QueueManager.
func (*QueueManager) Append ¶
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 ¶
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 ¶
func (t *QueueManager) Start()
Start the queue manager sending samples to the remote storage. Does not block.
func (*QueueManager) Stop ¶
func (t *QueueManager) Stop()
Stop stops sending samples to the remote storage and waits for pending sends to complete.
type ReadRequest ¶
type ReadRequest struct {
	Queries []*Query `protobuf:"bytes,1,rep,name=queries" json:"queries,omitempty"`
}
    func DecodeReadRequest ¶
func DecodeReadRequest(r *http.Request) (*ReadRequest, error)
DecodeReadRequest reads a remote.Request from a http.Request.
func (*ReadRequest) Descriptor ¶
func (*ReadRequest) Descriptor() ([]byte, []int)
func (*ReadRequest) GetQueries ¶
func (m *ReadRequest) GetQueries() []*Query
func (*ReadRequest) ProtoMessage ¶
func (*ReadRequest) ProtoMessage()
func (*ReadRequest) Reset ¶
func (m *ReadRequest) Reset()
func (*ReadRequest) String ¶
func (m *ReadRequest) String() string
type ReadResponse ¶
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 ¶
func (*ReadResponse) Descriptor() ([]byte, []int)
func (*ReadResponse) GetResults ¶
func (m *ReadResponse) GetResults() []*QueryResult
func (*ReadResponse) ProtoMessage ¶
func (*ReadResponse) ProtoMessage()
func (*ReadResponse) Reset ¶
func (m *ReadResponse) Reset()
func (*ReadResponse) String ¶
func (m *ReadResponse) String() string
type Reader ¶
type Reader struct {
	// contains filtered or unexported fields
}
    Reader allows reading from multiple remote sources.
func (*Reader) ApplyConfig ¶
ApplyConfig updates the state as the new config requires.
type Sample ¶
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 ¶
func (*Sample) GetTimestampMs ¶
func (*Sample) ProtoMessage ¶
func (*Sample) ProtoMessage()
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 ¶
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 ¶
func (*TimeSeries) Descriptor() ([]byte, []int)
func (*TimeSeries) GetLabels ¶
func (m *TimeSeries) GetLabels() []*LabelPair
func (*TimeSeries) GetSamples ¶
func (m *TimeSeries) GetSamples() []*Sample
func (*TimeSeries) ProtoMessage ¶
func (*TimeSeries) ProtoMessage()
func (*TimeSeries) Reset ¶
func (m *TimeSeries) Reset()
func (*TimeSeries) String ¶
func (m *TimeSeries) String() string
type WriteRequest ¶
type WriteRequest struct {
	Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries" json:"timeseries,omitempty"`
}
    func ToWriteRequest ¶
func ToWriteRequest(samples []*model.Sample) *WriteRequest
ToWriteRequest converts an array of samples into a WriteRequest proto.
func (*WriteRequest) Descriptor ¶
func (*WriteRequest) Descriptor() ([]byte, []int)
func (*WriteRequest) GetTimeseries ¶
func (m *WriteRequest) GetTimeseries() []*TimeSeries
func (*WriteRequest) ProtoMessage ¶
func (*WriteRequest) ProtoMessage()
func (*WriteRequest) Reset ¶
func (m *WriteRequest) Reset()
func (*WriteRequest) String ¶
func (m *WriteRequest) String() string
type Writer ¶
type Writer struct {
	// contains filtered or unexported fields
}
    Writer allows queueing samples for remote writes.
func (*Writer) ApplyConfig ¶
ApplyConfig updates the state as the new config requires.
func (*Writer) NeedsThrottling ¶
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.