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 WriteResponse
Index ¶
- func RegisterWriteServer(s *grpc.Server, srv WriteServer)
- type Client
- type LabelPair
- type Options
- type Sample
- type Storage
- func (s *Storage) Append(smpl *model.Sample) error
- func (s *Storage) ApplyConfig(conf *config.Config) error
- func (s *Storage) Collect(ch chan<- prometheus.Metric)
- func (s *Storage) Describe(ch chan<- *prometheus.Desc)
- func (s *Storage) NeedsThrottling() bool
- func (s *Storage) Run()
- func (s *Storage) Stop()
- type StorageClient
- type StorageQueueManager
- func (t *StorageQueueManager) Append(s *model.Sample) error
- func (t *StorageQueueManager) Collect(ch chan<- prometheus.Metric)
- func (t *StorageQueueManager) Describe(ch chan<- *prometheus.Desc)
- func (*StorageQueueManager) NeedsThrottling() bool
- func (t *StorageQueueManager) Run()
- func (t *StorageQueueManager) Stop()
- type StorageQueueManagerConfig
- type TimeSeries
- type WriteClient
- type WriteRequest
- type WriteResponse
- type WriteServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterWriteServer ¶
func RegisterWriteServer(s *grpc.Server, srv WriteServer)
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client allows sending batches of Prometheus samples to an HTTP endpoint.
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 (*LabelPair) Descriptor ¶
func (*LabelPair) ProtoMessage ¶
func (*LabelPair) ProtoMessage()
type Options ¶
type Options struct { StorageTimeout time.Duration InfluxdbURL *url.URL InfluxdbRetentionPolicy string InfluxdbUsername string InfluxdbPassword string InfluxdbDatabase string OpentsdbURL string GraphiteAddress string GraphiteTransport string GraphitePrefix string // TODO: This just being called "Address" will make more sense once the // other remote storage mechanisms are removed. Address string }
Options contains configuration parameters for a remote storage.
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) ProtoMessage ¶
func (*Sample) ProtoMessage()
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage collects multiple remote storage queues.
func (*Storage) ApplyConfig ¶
ApplyConfig updates the status state as the new config requires.
func (*Storage) Collect ¶
func (s *Storage) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Storage) Describe ¶
func (s *Storage) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*Storage) 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.
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 StorageQueueManager ¶
type StorageQueueManager struct {
// contains filtered or unexported fields
}
StorageQueueManager manages a queue of samples to be sent to the Storage indicated by the provided StorageClient.
func NewStorageQueueManager ¶
func NewStorageQueueManager(tsdb StorageClient, cfg *StorageQueueManagerConfig) *StorageQueueManager
NewStorageQueueManager builds a new StorageQueueManager.
func (*StorageQueueManager) Append ¶
func (t *StorageQueueManager) 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 (*StorageQueueManager) Collect ¶
func (t *StorageQueueManager) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*StorageQueueManager) Describe ¶
func (t *StorageQueueManager) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*StorageQueueManager) NeedsThrottling ¶
func (*StorageQueueManager) 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 (*StorageQueueManager) Run ¶
func (t *StorageQueueManager) Run()
Run continuously sends samples to the remote storage.
func (*StorageQueueManager) Stop ¶
func (t *StorageQueueManager) Stop()
Stop stops sending samples to the remote storage and waits for pending sends to complete.
type StorageQueueManagerConfig ¶
type StorageQueueManagerConfig struct { QueueCapacity int // Number of samples to buffer per shard before we start dropping them. Shards int // Number of shards, i.e. amount of concurrency. MaxSamplesPerSend int // Maximum number of samples per send. BatchSendDeadline time.Duration // Maximum time sample will wait in buffer. }
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 WriteClient ¶
type WriteClient interface {
Write(ctx context.Context, in *WriteRequest, opts ...grpc.CallOption) (*WriteResponse, error)
}
func NewWriteClient ¶
func NewWriteClient(cc *grpc.ClientConn) WriteClient
type WriteRequest ¶
type WriteRequest struct {
Timeseries []*TimeSeries `protobuf:"bytes,1,rep,name=timeseries" json:"timeseries,omitempty"`
}
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 WriteResponse ¶
type WriteResponse struct { }
func (*WriteResponse) Descriptor ¶
func (*WriteResponse) Descriptor() ([]byte, []int)
func (*WriteResponse) ProtoMessage ¶
func (*WriteResponse) ProtoMessage()
func (*WriteResponse) Reset ¶
func (m *WriteResponse) Reset()
func (*WriteResponse) String ¶
func (m *WriteResponse) String() string
type WriteServer ¶
type WriteServer interface {
Write(context.Context, *WriteRequest) (*WriteResponse, error)
}