Documentation ¶
Index ¶
- Constants
- Variables
- func NewWorker(cfg WorkerConfig, querierCfg querier.Config, server *server.Server, ...) (services.Service, error)
- func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
- type Config
- type Frontend
- func (f *Frontend) CheckReady(_ context.Context) error
- func (f *Frontend) Close()
- func (f *Frontend) Handler() http.Handler
- func (f *Frontend) Process(server Frontend_ProcessServer) error
- func (f *Frontend) RoundTrip(r *http.Request) (*http.Response, error)
- func (f *Frontend) RoundTripGRPC(ctx context.Context, req *ProcessRequest) (*ProcessResponse, error)
- func (f *Frontend) Wrap(trw Tripperware)
- type FrontendClient
- type FrontendServer
- type Frontend_ProcessClient
- type Frontend_ProcessServer
- type ProcessRequest
- func (*ProcessRequest) Descriptor() ([]byte, []int)
- func (this *ProcessRequest) Equal(that interface{}) bool
- func (m *ProcessRequest) GetHttpRequest() *httpgrpc.HTTPRequest
- func (this *ProcessRequest) GoString() string
- func (m *ProcessRequest) Marshal() (dAtA []byte, err error)
- func (m *ProcessRequest) MarshalTo(dAtA []byte) (int, error)
- func (m *ProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProcessRequest) ProtoMessage()
- func (m *ProcessRequest) Reset()
- func (m *ProcessRequest) Size() (n int)
- func (this *ProcessRequest) String() string
- func (m *ProcessRequest) Unmarshal(dAtA []byte) error
- func (m *ProcessRequest) XXX_DiscardUnknown()
- func (m *ProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcessRequest) XXX_Merge(src proto.Message)
- func (m *ProcessRequest) XXX_Size() int
- func (m *ProcessRequest) XXX_Unmarshal(b []byte) error
- type ProcessResponse
- func (*ProcessResponse) Descriptor() ([]byte, []int)
- func (this *ProcessResponse) Equal(that interface{}) bool
- func (m *ProcessResponse) GetHttpResponse() *httpgrpc.HTTPResponse
- func (this *ProcessResponse) GoString() string
- func (m *ProcessResponse) Marshal() (dAtA []byte, err error)
- func (m *ProcessResponse) MarshalTo(dAtA []byte) (int, error)
- func (m *ProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
- func (*ProcessResponse) ProtoMessage()
- func (m *ProcessResponse) Reset()
- func (m *ProcessResponse) Size() (n int)
- func (this *ProcessResponse) String() string
- func (m *ProcessResponse) Unmarshal(dAtA []byte) error
- func (m *ProcessResponse) XXX_DiscardUnknown()
- func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ProcessResponse) XXX_Merge(src proto.Message)
- func (m *ProcessResponse) XXX_Size() int
- func (m *ProcessResponse) XXX_Unmarshal(b []byte) error
- type RoundTripFunc
- type Tripperware
- type UnimplementedFrontendServer
- type WorkerConfig
Constants ¶
const (
// StatusClientClosedRequest is the status code for when a client request cancellation of an http request
StatusClientClosedRequest = 499
)
Variables ¶
var ( ErrInvalidLengthFrontend = fmt.Errorf("proto: negative length found during unmarshaling") ErrIntOverflowFrontend = fmt.Errorf("proto: integer overflow") )
Functions ¶
func NewWorker ¶
func NewWorker(cfg WorkerConfig, querierCfg querier.Config, server *server.Server, log log.Logger) (services.Service, error)
NewWorker creates a new worker and returns a service that is wrapping it. If no address is specified, it returns nil service (and no error).
func RegisterFrontendServer ¶
func RegisterFrontendServer(s *grpc.Server, srv FrontendServer)
Types ¶
type Config ¶
type Config struct { MaxOutstandingPerTenant int `yaml:"max_outstanding_per_tenant"` CompressResponses bool `yaml:"compress_responses"` DownstreamURL string `yaml:"downstream_url"` LogQueriesLongerThan time.Duration `yaml:"log_queries_longer_than"` }
Config for a Frontend.
func (*Config) RegisterFlags ¶
RegisterFlags adds the flags required to config this to the given FlagSet.
type Frontend ¶
type Frontend struct {
// contains filtered or unexported fields
}
Frontend queues HTTP requests, dispatches them to backends, and handles retries for requests which failed.
func New ¶
func New(cfg Config, log log.Logger, registerer prometheus.Registerer) (*Frontend, error)
New creates a new frontend.
func (*Frontend) CheckReady ¶ added in v1.3.0
CheckReady determines if the query frontend is ready. Function parameters/return chosen to match the same method in the ingester
func (*Frontend) Close ¶
func (f *Frontend) Close()
Close stops new requests and errors out any pending requests.
func (*Frontend) Process ¶
func (f *Frontend) Process(server Frontend_ProcessServer) error
Process allows backends to pull requests from the frontend.
func (*Frontend) RoundTripGRPC ¶
func (f *Frontend) RoundTripGRPC(ctx context.Context, req *ProcessRequest) (*ProcessResponse, error)
RoundTripGRPC round trips a proto (instead of a HTTP request).
func (*Frontend) Wrap ¶ added in v0.4.0
func (f *Frontend) Wrap(trw Tripperware)
Wrap uses a Tripperware to chain a new RoundTripper to the frontend.
type FrontendClient ¶
type FrontendClient interface {
Process(ctx context.Context, opts ...grpc.CallOption) (Frontend_ProcessClient, error)
}
FrontendClient is the client API for Frontend service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://godoc.org/google.golang.org/grpc#ClientConn.NewStream.
func NewFrontendClient ¶
func NewFrontendClient(cc *grpc.ClientConn) FrontendClient
type FrontendServer ¶
type FrontendServer interface {
Process(Frontend_ProcessServer) error
}
FrontendServer is the server API for Frontend service.
type Frontend_ProcessClient ¶
type Frontend_ProcessClient interface { Send(*ProcessResponse) error Recv() (*ProcessRequest, error) grpc.ClientStream }
type Frontend_ProcessServer ¶
type Frontend_ProcessServer interface { Send(*ProcessRequest) error Recv() (*ProcessResponse, error) grpc.ServerStream }
type ProcessRequest ¶
type ProcessRequest struct {
HttpRequest *httpgrpc.HTTPRequest `protobuf:"bytes,1,opt,name=httpRequest,proto3" json:"httpRequest,omitempty"`
}
func (*ProcessRequest) Descriptor ¶
func (*ProcessRequest) Descriptor() ([]byte, []int)
func (*ProcessRequest) Equal ¶
func (this *ProcessRequest) Equal(that interface{}) bool
func (*ProcessRequest) GetHttpRequest ¶
func (m *ProcessRequest) GetHttpRequest() *httpgrpc.HTTPRequest
func (*ProcessRequest) GoString ¶
func (this *ProcessRequest) GoString() string
func (*ProcessRequest) Marshal ¶
func (m *ProcessRequest) Marshal() (dAtA []byte, err error)
func (*ProcessRequest) MarshalToSizedBuffer ¶ added in v0.7.0
func (m *ProcessRequest) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProcessRequest) ProtoMessage ¶
func (*ProcessRequest) ProtoMessage()
func (*ProcessRequest) Reset ¶
func (m *ProcessRequest) Reset()
func (*ProcessRequest) Size ¶
func (m *ProcessRequest) Size() (n int)
func (*ProcessRequest) String ¶
func (this *ProcessRequest) String() string
func (*ProcessRequest) Unmarshal ¶
func (m *ProcessRequest) Unmarshal(dAtA []byte) error
func (*ProcessRequest) XXX_DiscardUnknown ¶
func (m *ProcessRequest) XXX_DiscardUnknown()
func (*ProcessRequest) XXX_Marshal ¶
func (m *ProcessRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessRequest) XXX_Merge ¶
func (m *ProcessRequest) XXX_Merge(src proto.Message)
func (*ProcessRequest) XXX_Size ¶
func (m *ProcessRequest) XXX_Size() int
func (*ProcessRequest) XXX_Unmarshal ¶
func (m *ProcessRequest) XXX_Unmarshal(b []byte) error
type ProcessResponse ¶
type ProcessResponse struct {
HttpResponse *httpgrpc.HTTPResponse `protobuf:"bytes,1,opt,name=httpResponse,proto3" json:"httpResponse,omitempty"`
}
func (*ProcessResponse) Descriptor ¶
func (*ProcessResponse) Descriptor() ([]byte, []int)
func (*ProcessResponse) Equal ¶
func (this *ProcessResponse) Equal(that interface{}) bool
func (*ProcessResponse) GetHttpResponse ¶
func (m *ProcessResponse) GetHttpResponse() *httpgrpc.HTTPResponse
func (*ProcessResponse) GoString ¶
func (this *ProcessResponse) GoString() string
func (*ProcessResponse) Marshal ¶
func (m *ProcessResponse) Marshal() (dAtA []byte, err error)
func (*ProcessResponse) MarshalToSizedBuffer ¶ added in v0.7.0
func (m *ProcessResponse) MarshalToSizedBuffer(dAtA []byte) (int, error)
func (*ProcessResponse) ProtoMessage ¶
func (*ProcessResponse) ProtoMessage()
func (*ProcessResponse) Reset ¶
func (m *ProcessResponse) Reset()
func (*ProcessResponse) Size ¶
func (m *ProcessResponse) Size() (n int)
func (*ProcessResponse) String ¶
func (this *ProcessResponse) String() string
func (*ProcessResponse) Unmarshal ¶
func (m *ProcessResponse) Unmarshal(dAtA []byte) error
func (*ProcessResponse) XXX_DiscardUnknown ¶
func (m *ProcessResponse) XXX_DiscardUnknown()
func (*ProcessResponse) XXX_Marshal ¶
func (m *ProcessResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ProcessResponse) XXX_Merge ¶
func (m *ProcessResponse) XXX_Merge(src proto.Message)
func (*ProcessResponse) XXX_Size ¶
func (m *ProcessResponse) XXX_Size() int
func (*ProcessResponse) XXX_Unmarshal ¶
func (m *ProcessResponse) XXX_Unmarshal(b []byte) error
type RoundTripFunc ¶ added in v0.2.0
RoundTripFunc is to http.RoundTripper what http.HandlerFunc is to http.Handler.
type Tripperware ¶ added in v0.4.0
type Tripperware func(http.RoundTripper) http.RoundTripper
Tripperware is a signature for all http client-side middleware.
type UnimplementedFrontendServer ¶ added in v0.7.0
type UnimplementedFrontendServer struct { }
UnimplementedFrontendServer can be embedded to have forward compatible implementations.
func (*UnimplementedFrontendServer) Process ¶ added in v0.7.0
func (*UnimplementedFrontendServer) Process(srv Frontend_ProcessServer) error
type WorkerConfig ¶
type WorkerConfig struct { Address string `yaml:"frontend_address"` Parallelism int `yaml:"parallelism"` MatchMaxConcurrency bool `yaml:"match_max_concurrent"` DNSLookupDuration time.Duration `yaml:"dns_lookup_duration"` GRPCClientConfig grpcclient.ConfigWithTLS `yaml:"grpc_client_config"` }
WorkerConfig is config for a worker.
func (*WorkerConfig) RegisterFlags ¶
func (cfg *WorkerConfig) RegisterFlags(f *flag.FlagSet)
RegisterFlags adds the flags required to config this to the given FlagSet.