Documentation
¶
Index ¶
- type Config
- type Distributor
- func (*Distributor) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (d *Distributor) Push(ctx context.Context, req *logproto.PushRequest) (*logproto.PushResponse, error)
- func (d *Distributor) PushHandler(w http.ResponseWriter, r *http.Request)
- func (d *Distributor) ReadinessHandler(w http.ResponseWriter, r *http.Request)
- func (d *Distributor) Stop()
- type Limits
- type ReadLifecycler
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Distributors ring
DistributorRing cortex_distributor.RingConfig `yaml:"ring,omitempty"`
// contains filtered or unexported fields
}
Config for a Distributor.
func (*Config) RegisterFlags ¶
func (cfg *Config) RegisterFlags(f *flag.FlagSet)
RegisterFlags registers the flags.
type Distributor ¶
type Distributor struct {
// contains filtered or unexported fields
}
Distributor coordinates replicates and distribution of log streams.
func New ¶
func New(cfg Config, clientCfg client.Config, ingestersRing ring.ReadRing, overrides *validation.Overrides) (*Distributor, error)
New a distributor creates.
func (*Distributor) Check ¶
func (*Distributor) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
Check implements the grpc healthcheck
func (*Distributor) Push ¶
func (d *Distributor) Push(ctx context.Context, req *logproto.PushRequest) (*logproto.PushResponse, error)
Push a set of streams.
func (*Distributor) PushHandler ¶
func (d *Distributor) PushHandler(w http.ResponseWriter, r *http.Request)
PushHandler reads a snappy-compressed proto from the HTTP body.
func (*Distributor) ReadinessHandler ¶ added in v0.3.0
func (d *Distributor) ReadinessHandler(w http.ResponseWriter, r *http.Request)
ReadinessHandler is used to indicate to k8s when the distributor is ready. Returns 200 when the distributor is ready, 500 otherwise.
type Limits ¶ added in v1.4.0
type Limits interface {
MaxLineSize(userID string) int
EnforceMetricName(userID string) bool
MaxLabelNamesPerSeries(userID string) int
MaxLabelNameLength(userID string) int
MaxLabelValueLength(userID string) int
CreationGracePeriod(userID string) time.Duration
RejectOldSamples(userID string) bool
RejectOldSamplesMaxAge(userID string) time.Duration
}
Limits is an interface for distributor limits/related configs
type ReadLifecycler ¶ added in v1.3.0
type ReadLifecycler interface {
HealthyInstancesCount() int
}
ReadLifecycler represents the read interface to the lifecycler.
type Validator ¶ added in v1.4.0
type Validator struct {
Limits
}
func NewValidator ¶ added in v1.4.0
func NewValidator(l Limits) (*Validator, error)
func (Validator) ValidateEntry ¶ added in v1.4.0
func (v Validator) ValidateEntry(userID string, entry logproto.Entry) error
ValidateEntry returns an error if the entry is invalid
func (Validator) ValidateLabels ¶ added in v1.4.0
func (v Validator) ValidateLabels(userID string, labels string) error
Validate labels returns an error if the labels are invalid