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
- Variables
- type Config
- type Frontend
- func (f *Frontend) CheckReady(ctx context.Context) error
- func (f *Frontend) ExceedsLimits(ctx context.Context, req *proto.ExceedsLimitsRequest) (*proto.ExceedsLimitsResponse, error)
- func (f *Frontend) Flush()
- func (f *Frontend) ServeHTTP(w http.ResponseWriter, r *http.Request)
- func (f *Frontend) TransferOut(_ context.Context) error
Constants ¶
const ( RingKey = "ingest-limits-frontend" RingName = "ingest-limits-frontend" )
Variables ¶
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 ¶
type Frontend ¶
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) ExceedsLimits ¶
func (f *Frontend) ExceedsLimits(ctx context.Context, req *proto.ExceedsLimitsRequest) (*proto.ExceedsLimitsResponse, error)
ExceedsLimits implements proto.IngestLimitsFrontendClient.
func (*Frontend) Flush ¶
func (f *Frontend) Flush()
Flush implements ring.FlushTransferer. It transfers state to another ingest limits frontend instance.