Documentation
¶
Overview ¶
Package client provides gRPC client implementation for limits-frontend. An example use case is the distributor, which needs to ask limits-frontend if a push request has exceeded per-tenant limits.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
LimitsRead = ring.NewOp([]ring.InstanceState{ring.ACTIVE}, nil)
)
Functions ¶
func NewPool ¶
func NewPool( name string, cfg PoolConfig, ring ring.ReadRing, factory ring_client.PoolFactory, logger log.Logger, ) *ring_client.Pool
NewPool returns a new pool of clients for the ingest-limits-frontend.
func NewPoolFactory ¶
func NewPoolFactory(cfg Config) ring_client.PoolFactory
NewPoolFactory returns a new factory for ingest-limits-frontend clients.
Types ¶
type Client ¶
type Client struct {
proto.IngestLimitsFrontendClient
grpc_health_v1.HealthClient
io.Closer
}
Client is a gRPC client for the ingest-limits-frontend.
type Config ¶
type Config struct {
GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config" doc:"description=Configures client gRPC connections to limits service."`
PoolConfig PoolConfig `yaml:"pool_config,omitempty" doc:"description=Configures client gRPC connections pool to limits service."`
GRPCUnaryClientInterceptors []grpc.UnaryClientInterceptor `yaml:"-"`
GRCPStreamClientInterceptors []grpc.StreamClientInterceptor `yaml:"-"`
// Internal is used to indicate that this client communicates on behalf of
// a machine and not a user. When Internal = true, the client won't attempt
// to inject an userid into the context.
Internal bool `yaml:"-"`
}
Config contains the config for an ingest-limits-frontend client.
func (*Config) RegisterFlags ¶
func (*Config) RegisterFlagsWithPrefix ¶
type PoolConfig ¶
type PoolConfig struct {
ClientCleanupPeriod time.Duration `yaml:"client_cleanup_period"`
HealthCheckIngestLimits bool `yaml:"health_check_ingest_limits"`
RemoteTimeout time.Duration `yaml:"remote_timeout"`
}
PoolConfig contains the config for a pool of ingest-limits-frontend clients.
func (*PoolConfig) RegisterFlagsWithPrefix ¶
func (cfg *PoolConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
Click to show internal directories.
Click to hide internal directories.