client

package
v3.7.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 13, 2026 License: AGPL-3.0 Imports: 16 Imported by: 0

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

Client is a gRPC client for the ingest-limits-frontend.

func NewClient

func NewClient(cfg Config, addr string) (*Client, error)

NewClient returns a new Client for the specified 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 (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) RegisterFlagsWithPrefix

func (cfg *Config) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL