frontend

package
v3.6.7 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: AGPL-3.0 Imports: 25 Imported by: 0

Documentation

Overview

Package frontend contains provides a frontend service for ingest limits. It is responsible for receiving and answering gRPC requests from distributors, such as exceeds limits requests, forwarding them to individual limits backends, gathering and aggregating their responses (where required), and returning the final result.

Index

Constants

View Source
const (
	RingKey  = "ingest-limits-frontend"
	RingName = "ingest-limits-frontend"
)

Variables

View Source
var (
	LimitsRead = ring.NewOp([]ring.InstanceState{ring.ACTIVE}, nil)
)

Functions

This section is empty.

Types

type Config

type Config struct {
	ClientConfig               limits_client.Config  `yaml:"client_config"`
	LifecyclerConfig           ring.LifecyclerConfig `yaml:"lifecycler,omitempty"`
	NumPartitions              int                   `yaml:"num_partitions"`
	AssignedPartitionsCacheTTL time.Duration         `yaml:"assigned_partitions_cache_ttl"`
}

Config contains the config for an ingest-limits-frontend.

func (*Config) RegisterFlags

func (cfg *Config) RegisterFlags(f *flag.FlagSet)

func (*Config) Validate

func (cfg *Config) Validate() error

type Frontend

type Frontend struct {
	services.Service
	// contains filtered or unexported fields
}

Frontend is a frontend for the limits service. It is responsible for receiving RPCs from clients, forwarding them to the correct limits instances, and returning their responses.

func New

func New(cfg Config, ringName string, limitsRing ring.ReadRing, logger log.Logger, reg prometheus.Registerer) (*Frontend, error)

New returns a new Frontend.

func (*Frontend) CheckReady

func (f *Frontend) CheckReady(ctx context.Context) error

func (*Frontend) ExceedsLimits

ExceedsLimits implements proto.IngestLimitsFrontendClient.

func (*Frontend) Flush

func (f *Frontend) Flush()

Flush implements ring.FlushTransferer. It transfers state to another ingest limits frontend instance.

func (*Frontend) ServeHTTP

func (f *Frontend) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements http.Handler.

func (*Frontend) TransferOut

func (f *Frontend) TransferOut(_ context.Context) error

TransferOut implements ring.FlushTransferer. It transfers state to another ingest limits frontend instance.

Directories

Path Synopsis
Package client provides gRPC client implementation for limits-frontend.
Package client provides gRPC client implementation for limits-frontend.

Jump to

Keyboard shortcuts

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