Documentation ¶
Index ¶
- type GatewayClient
- func (s *GatewayClient) BatchWrite(_ context.Context, _ index.WriteBatch) error
- func (s *GatewayClient) GetChunkRef(ctx context.Context, in *logproto.GetChunkRefRequest, opts ...grpc.CallOption) (*logproto.GetChunkRefResponse, error)
- func (s *GatewayClient) GetLabelVolume(ctx context.Context, in *logproto.LabelVolumeRequest, opts ...grpc.CallOption) (*logproto.LabelVolumeResponse, error)
- func (s *GatewayClient) GetSeries(ctx context.Context, in *logproto.GetSeriesRequest, opts ...grpc.CallOption) (*logproto.GetSeriesResponse, error)
- func (s *GatewayClient) GetStats(ctx context.Context, in *logproto.IndexStatsRequest, opts ...grpc.CallOption) (*logproto.IndexStatsResponse, error)
- func (s *GatewayClient) LabelNamesForMetricName(ctx context.Context, in *logproto.LabelNamesForMetricNameRequest, ...) (*logproto.LabelResponse, error)
- func (s *GatewayClient) LabelValuesForMetricName(ctx context.Context, in *logproto.LabelValuesForMetricNameRequest, ...) (*logproto.LabelResponse, error)
- func (s *GatewayClient) NewWriteBatch() index.WriteBatch
- func (s *GatewayClient) QueryIndex(_ context.Context, _ *logproto.QueryIndexRequest, _ ...grpc.CallOption) (logproto.IndexGateway_QueryIndexClient, error)
- func (s *GatewayClient) QueryPages(ctx context.Context, queries []index.Query, callback index.QueryPagesCallback) error
- func (s *GatewayClient) Stop()
- type IndexGatewayClientConfig
- type IndexGatewayGRPCPool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GatewayClient ¶
type GatewayClient struct {
// contains filtered or unexported fields
}
func NewGatewayClient ¶
func NewGatewayClient(cfg IndexGatewayClientConfig, r prometheus.Registerer, logger log.Logger) (*GatewayClient, error)
NewGatewayClient instantiates a new client used to communicate with an Index Gateway instance.
If it is configured to be in ring mode, a pool of GRPC connections to all Index Gateway instances is created. Otherwise, it creates a single GRPC connection to an Index Gateway instance running in simple mode.
func (*GatewayClient) BatchWrite ¶
func (s *GatewayClient) BatchWrite(_ context.Context, _ index.WriteBatch) error
func (*GatewayClient) GetChunkRef ¶
func (s *GatewayClient) GetChunkRef(ctx context.Context, in *logproto.GetChunkRefRequest, opts ...grpc.CallOption) (*logproto.GetChunkRefResponse, error)
func (*GatewayClient) GetLabelVolume ¶
func (s *GatewayClient) GetLabelVolume(ctx context.Context, in *logproto.LabelVolumeRequest, opts ...grpc.CallOption) (*logproto.LabelVolumeResponse, error)
func (*GatewayClient) GetSeries ¶
func (s *GatewayClient) GetSeries(ctx context.Context, in *logproto.GetSeriesRequest, opts ...grpc.CallOption) (*logproto.GetSeriesResponse, error)
func (*GatewayClient) GetStats ¶
func (s *GatewayClient) GetStats(ctx context.Context, in *logproto.IndexStatsRequest, opts ...grpc.CallOption) (*logproto.IndexStatsResponse, error)
func (*GatewayClient) LabelNamesForMetricName ¶
func (s *GatewayClient) LabelNamesForMetricName(ctx context.Context, in *logproto.LabelNamesForMetricNameRequest, opts ...grpc.CallOption) (*logproto.LabelResponse, error)
func (*GatewayClient) LabelValuesForMetricName ¶
func (s *GatewayClient) LabelValuesForMetricName(ctx context.Context, in *logproto.LabelValuesForMetricNameRequest, opts ...grpc.CallOption) (*logproto.LabelResponse, error)
func (*GatewayClient) NewWriteBatch ¶
func (s *GatewayClient) NewWriteBatch() index.WriteBatch
func (*GatewayClient) QueryIndex ¶
func (s *GatewayClient) QueryIndex(_ context.Context, _ *logproto.QueryIndexRequest, _ ...grpc.CallOption) (logproto.IndexGateway_QueryIndexClient, error)
func (*GatewayClient) QueryPages ¶
func (s *GatewayClient) QueryPages(ctx context.Context, queries []index.Query, callback index.QueryPagesCallback) error
func (*GatewayClient) Stop ¶
func (s *GatewayClient) Stop()
Stop stops the execution of this gateway client.
If it is in simple mode, the single GRPC connection is closed. Otherwise, nothing happens.
type IndexGatewayClientConfig ¶
type IndexGatewayClientConfig struct { // Mode sets in which mode the client will operate. It is actually defined at the // index_gateway YAML section and reused here. Mode indexgateway.Mode `yaml:"-"` // PoolConfig defines the behavior of the gRPC connection pool used to communicate // with the Index Gateway. // // Only relevant for the ring mode. // It is defined at the distributors YAML section and reused here. PoolConfig clientpool.PoolConfig `yaml:"-"` // Ring is the Index Gateway ring used to find the appropriate Index Gateway instance // this client should talk to. // // Only relevant for the ring mode. Ring ring.ReadRing `yaml:"-"` // GRPCClientConfig configures the gRPC connection between the Index Gateway client and the server. // // Used by both, ring and simple mode. GRPCClientConfig grpcclient.Config `yaml:"grpc_client_config"` // Address of the Index Gateway instance responsible for retaining the index for all tenants. // // Only relevant for the simple mode. Address string `yaml:"server_address,omitempty"` // Forcefully disable the use of the index gateway client for the storage. // This is mainly useful for the index-gateway component which should always use the storage. Disabled bool `yaml:"-"` // LogGatewayRequests configures if requests sent to the gateway should be logged or not. // The log messages are of type debug and contain the address of the gateway and the relevant tenant. LogGatewayRequests bool `yaml:"log_gateway_requests"` }
IndexGatewayClientConfig configures the Index Gateway client used to communicate with the Index Gateway server.
func (*IndexGatewayClientConfig) RegisterFlags ¶
func (i *IndexGatewayClientConfig) RegisterFlags(f *flag.FlagSet)
func (*IndexGatewayClientConfig) RegisterFlagsWithPrefix ¶
func (i *IndexGatewayClientConfig) RegisterFlagsWithPrefix(prefix string, f *flag.FlagSet)
RegisterFlagsWithPrefix register client-specific flags with the given prefix.
Flags that are used by both, client and server, are defined in the indexgateway package.
type IndexGatewayGRPCPool ¶
type IndexGatewayGRPCPool struct { grpc_health_v1.HealthClient logproto.IndexGatewayClient io.Closer }
IndexGatewayGRPCPool represents a pool of gRPC connections to different index gateway instances.
Only used when Index Gateway is configured to run in ring mode.
func NewIndexGatewayGRPCPool ¶
func NewIndexGatewayGRPCPool(address string, opts []grpc.DialOption) (*IndexGatewayGRPCPool, error)
NewIndexGatewayGRPCPool instantiates a new pool of IndexGateway GRPC connections.
Internally, it also instantiates a protobuf index gateway client and a health client.