Documentation ¶
Index ¶
- func ParseProtoRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, req proto.Message, ...) error
- func WriteJSONResponse(w http.ResponseWriter, v interface{})
- type Config
- type Distributor
- func (d *Distributor) Collect(ch chan<- prometheus.Metric)
- func (d *Distributor) Describe(ch chan<- *prometheus.Desc)
- func (d *Distributor) LabelValuesForLabelName(ctx context.Context, labelName model.LabelName) (model.LabelValues, error)
- func (d *Distributor) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, ...) ([]metric.Metric, error)
- func (d *Distributor) Push(ctx context.Context, req *cortex.WriteRequest) (*cortex.WriteResponse, error)
- func (d *Distributor) PushHandler(w http.ResponseWriter, r *http.Request)
- func (d *Distributor) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error)
- func (d *Distributor) Run()
- func (d *Distributor) Stop()
- func (d *Distributor) UserStats(ctx context.Context) (*UserStats, error)
- func (d *Distributor) UserStatsHandler(w http.ResponseWriter, r *http.Request)
- func (d *Distributor) ValidateExprHandler(w http.ResponseWriter, r *http.Request)
- type ReadRing
- type UserStats
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ParseProtoRequest ¶
func ParseProtoRequest(ctx context.Context, w http.ResponseWriter, r *http.Request, req proto.Message, compressed bool) error
ParseProtoRequest parses a proto from the body of a http request.
func WriteJSONResponse ¶
func WriteJSONResponse(w http.ResponseWriter, v interface{})
WriteJSONResponse writes some JSON as a HTTP response.
Types ¶
type Config ¶
type Config struct { ReplicationFactor int HeartbeatTimeout time.Duration RemoteTimeout time.Duration ClientCleanupPeriod time.Duration IngestionRateLimit float64 IngestionBurstSize int // contains filtered or unexported fields }
Config contains the configuration require to create a Distributor
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
Distributor is a storage.SampleAppender and a cortex.Querier which forwards appends and queries to individual ingesters.
func New ¶
func New(cfg Config, ring ReadRing) (*Distributor, error)
New constructs a new Distributor
func (*Distributor) Collect ¶
func (d *Distributor) Collect(ch chan<- prometheus.Metric)
Collect implements prometheus.Collector.
func (*Distributor) Describe ¶
func (d *Distributor) Describe(ch chan<- *prometheus.Desc)
Describe implements prometheus.Collector.
func (*Distributor) LabelValuesForLabelName ¶
func (d *Distributor) LabelValuesForLabelName(ctx context.Context, labelName model.LabelName) (model.LabelValues, error)
LabelValuesForLabelName returns all of the label values that are associated with a given label name.
func (*Distributor) MetricsForLabelMatchers ¶
func (d *Distributor) MetricsForLabelMatchers(ctx context.Context, from, through model.Time, matchers ...metric.LabelMatchers) ([]metric.Metric, error)
MetricsForLabelMatchers gets the metrics that match said matchers
func (*Distributor) Push ¶
func (d *Distributor) Push(ctx context.Context, req *cortex.WriteRequest) (*cortex.WriteResponse, error)
Push implements cortex.IngesterServer
func (*Distributor) PushHandler ¶
func (d *Distributor) PushHandler(w http.ResponseWriter, r *http.Request)
PushHandler is a http.Handler which accepts WriteRequests.
func (*Distributor) Query ¶
func (d *Distributor) Query(ctx context.Context, from, to model.Time, matchers ...*metric.LabelMatcher) (model.Matrix, error)
Query implements Querier.
func (*Distributor) Run ¶
func (d *Distributor) Run()
Run starts the distributor's maintenance loop.
func (*Distributor) Stop ¶
func (d *Distributor) Stop()
Stop stops the distributor's maintenance loop.
func (*Distributor) UserStats ¶
func (d *Distributor) UserStats(ctx context.Context) (*UserStats, error)
UserStats returns statistics about the current user.
func (*Distributor) UserStatsHandler ¶
func (d *Distributor) UserStatsHandler(w http.ResponseWriter, r *http.Request)
UserStatsHandler handles user stats to the Distributor.
func (*Distributor) ValidateExprHandler ¶
func (d *Distributor) ValidateExprHandler(w http.ResponseWriter, r *http.Request)
ValidateExprHandler validates a PromQL expression.
type ReadRing ¶
type ReadRing interface { prometheus.Collector Get(key uint32, n int, op ring.Operation) ([]*ring.IngesterDesc, error) BatchGet(keys []uint32, n int, op ring.Operation) ([][]*ring.IngesterDesc, error) GetAll() []*ring.IngesterDesc }
ReadRing represents the read inferface to the ring.