Documentation
¶
Index ¶
- func NewQuerierHTTPHandler(h *Handler) http.Handler
- func WrapQuerySpanAndTimeout(call string, limits Limits) middleware.Interface
- type Config
- type Engine
- type Handler
- type Limits
- type PatterQuerier
- type Querier
- type QuerierAPI
- func (q *QuerierAPI) DetectedFieldsHandler(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error)
- func (q *QuerierAPI) DetectedLabelsHandler(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error)
- func (q *QuerierAPI) IndexShardsHandler(ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64) (*logproto.ShardsResponse, error)
- func (q *QuerierAPI) IndexStatsHandler(ctx context.Context, req *loghttp.RangeQuery) (*logproto.IndexStatsResponse, error)
- func (q *QuerierAPI) InstantQueryHandler(ctx context.Context, req *queryrange.LokiInstantRequest) (logqlmodel.Result, error)
- func (q *QuerierAPI) LabelHandler(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error)
- func (q *QuerierAPI) PatternsHandler(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error)
- func (q *QuerierAPI) RangeQueryHandler(ctx context.Context, req *queryrange.LokiRequest) (logqlmodel.Result, error)
- func (q *QuerierAPI) SeriesHandler(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, stats.Result, error)
- func (q *QuerierAPI) TailHandler(w http.ResponseWriter, r *http.Request)
- func (q *QuerierAPI) VolumeHandler(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error)
- type QueryResponse
- type Rf1Querier
- func (*Rf1Querier) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
- func (q *Rf1Querier) DetectedFields(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error)
- func (q *Rf1Querier) DetectedLabels(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error)
- func (q *Rf1Querier) IndexShards(ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64) (*logproto.ShardsResponse, error)
- func (q *Rf1Querier) IndexStats(ctx context.Context, req *loghttp.RangeQuery) (*stats.Stats, error)
- func (q *Rf1Querier) Label(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error)
- func (q *Rf1Querier) Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error)
- func (q *Rf1Querier) SelectLogs(ctx context.Context, params logql.SelectLogParams) (iter.EntryIterator, error)
- func (q *Rf1Querier) SelectSamples(ctx context.Context, params logql.SelectSampleParams) (iter.SampleIterator, error)
- func (q *Rf1Querier) Series(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error)
- func (q *Rf1Querier) Tail(_ context.Context, _ *logproto.TailRequest, _ bool) (*querier.Tailer, error)
- func (q *Rf1Querier) Volume(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error)
- func (q *Rf1Querier) WithPatternQuerier(pq querier.PatterQuerier)
- type Store
- type TimeRangeLimits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewQuerierHTTPHandler ¶
func WrapQuerySpanAndTimeout ¶
func WrapQuerySpanAndTimeout(call string, limits Limits) middleware.Interface
WrapQuerySpanAndTimeout applies a context deadline and a span logger to a query call.
The timeout is based on the per-tenant query timeout configuration.
Types ¶
type Config ¶
type Config struct { Enabled bool ExtraQueryDelay time.Duration `yaml:"extra_query_delay,omitempty"` Engine logql.EngineOpts `yaml:"engine,omitempty"` MaxConcurrent int `yaml:"max_concurrent"` PerRequestLimitsEnabled bool `yaml:"per_request_limits_enabled"` }
func (*Config) RegisterFlags ¶
RegisterFlags register flags.
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewQuerierHandler ¶
func NewQuerierHandler(api *QuerierAPI) *Handler
func (*Handler) Do ¶
func (h *Handler) Do(ctx context.Context, req queryrangebase.Request) (queryrangebase.Response, error)
type Limits ¶
type Limits querier_limits.Limits
type PatterQuerier ¶
type PatterQuerier interface {
Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error)
}
type Querier ¶
type Querier interface { logql.Querier Label(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error) Series(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error) Tail(ctx context.Context, req *logproto.TailRequest, categorizedLabels bool) (*querier.Tailer, error) IndexStats(ctx context.Context, req *loghttp.RangeQuery) (*stats.Stats, error) IndexShards(ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64) (*logproto.ShardsResponse, error) Volume(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error) DetectedFields(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error) Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error) DetectedLabels(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error) }
Querier can select logs and samples and handle query requests.
type QuerierAPI ¶
type QuerierAPI struct {
// contains filtered or unexported fields
}
nolint // QuerierAPI defines HTTP handler functions for the querier.
func NewQuerierAPI ¶
NewQuerierAPI returns an instance of the QuerierAPI.
func (*QuerierAPI) DetectedFieldsHandler ¶
func (q *QuerierAPI) DetectedFieldsHandler(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error)
func (*QuerierAPI) DetectedLabelsHandler ¶
func (q *QuerierAPI) DetectedLabelsHandler(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error)
DetectedLabelsHandler returns a response for detected labels
func (*QuerierAPI) IndexShardsHandler ¶
func (q *QuerierAPI) IndexShardsHandler(ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64) (*logproto.ShardsResponse, error)
func (*QuerierAPI) IndexStatsHandler ¶
func (q *QuerierAPI) IndexStatsHandler(ctx context.Context, req *loghttp.RangeQuery) (*logproto.IndexStatsResponse, error)
IndexStatsHandler queries the index for the data statistics related to a query
func (*QuerierAPI) InstantQueryHandler ¶
func (q *QuerierAPI) InstantQueryHandler(ctx context.Context, req *queryrange.LokiInstantRequest) (logqlmodel.Result, error)
InstantQueryHandler is a http.HandlerFunc for instant queries.
func (*QuerierAPI) LabelHandler ¶
func (q *QuerierAPI) LabelHandler(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error)
LabelHandler is a http.HandlerFunc for handling label queries.
func (*QuerierAPI) PatternsHandler ¶
func (q *QuerierAPI) PatternsHandler(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error)
func (*QuerierAPI) RangeQueryHandler ¶
func (q *QuerierAPI) RangeQueryHandler(ctx context.Context, req *queryrange.LokiRequest) (logqlmodel.Result, error)
RangeQueryHandler is a http.HandlerFunc for range queries and legacy log queries
func (*QuerierAPI) SeriesHandler ¶
func (q *QuerierAPI) SeriesHandler(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, stats.Result, error)
SeriesHandler returns the list of time series that match a certain label set. See https://prometheus.io/docs/prometheus/latest/querying/api/#finding-series-by-label-matchers
func (*QuerierAPI) TailHandler ¶
func (q *QuerierAPI) TailHandler(w http.ResponseWriter, r *http.Request)
TailHandler is a http.HandlerFunc for handling tail queries.
func (*QuerierAPI) VolumeHandler ¶
func (q *QuerierAPI) VolumeHandler(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error)
VolumeHandler queries the index label volumes related to the passed matchers and given time range. Returns either N values where N is the time range / step and a single value for a time range depending on the request.
type QueryResponse ¶
type Rf1Querier ¶
type Rf1Querier struct {
// contains filtered or unexported fields
}
Rf1Querier handles rf1 queries.
func New ¶
func New(cfg Config, store Store, limits Limits, d deleteGetter, metastore wal.Metastore, b wal.BlockStorage, logger log.Logger) (*Rf1Querier, error)
New makes a new Querier for RF1 work.
func (*Rf1Querier) Check ¶
func (*Rf1Querier) Check(_ context.Context, _ *grpc_health_v1.HealthCheckRequest) (*grpc_health_v1.HealthCheckResponse, error)
Check implements the grpc healthcheck
func (*Rf1Querier) DetectedFields ¶
func (q *Rf1Querier) DetectedFields(ctx context.Context, req *logproto.DetectedFieldsRequest) (*logproto.DetectedFieldsResponse, error)
func (*Rf1Querier) DetectedLabels ¶
func (q *Rf1Querier) DetectedLabels(ctx context.Context, req *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error)
DetectedLabels fetches labels and values from store and ingesters and filters them by relevance criteria as per logs app.
func (*Rf1Querier) IndexShards ¶
func (q *Rf1Querier) IndexShards( ctx context.Context, req *loghttp.RangeQuery, targetBytesPerShard uint64, ) (*logproto.ShardsResponse, error)
func (*Rf1Querier) IndexStats ¶
func (q *Rf1Querier) IndexStats(ctx context.Context, req *loghttp.RangeQuery) (*stats.Stats, error)
func (*Rf1Querier) Label ¶
func (q *Rf1Querier) Label(ctx context.Context, req *logproto.LabelRequest) (*logproto.LabelResponse, error)
Label does the heavy lifting for a Label query.
func (*Rf1Querier) Patterns ¶
func (q *Rf1Querier) Patterns(ctx context.Context, req *logproto.QueryPatternsRequest) (*logproto.QueryPatternsResponse, error)
func (*Rf1Querier) SelectLogs ¶
func (q *Rf1Querier) SelectLogs(ctx context.Context, params logql.SelectLogParams) (iter.EntryIterator, error)
Select Implements logql.Querier which select logs via matchers and regex filters.
func (*Rf1Querier) SelectSamples ¶
func (q *Rf1Querier) SelectSamples(ctx context.Context, params logql.SelectSampleParams) (iter.SampleIterator, error)
func (*Rf1Querier) Series ¶
func (q *Rf1Querier) Series(ctx context.Context, req *logproto.SeriesRequest) (*logproto.SeriesResponse, error)
Series fetches any matching series for a list of matcher sets
func (*Rf1Querier) Tail ¶
func (q *Rf1Querier) Tail(_ context.Context, _ *logproto.TailRequest, _ bool) (*querier.Tailer, error)
Tail keeps getting matching logs from all ingesters for given query
func (*Rf1Querier) Volume ¶
func (q *Rf1Querier) Volume(ctx context.Context, req *logproto.VolumeRequest) (*logproto.VolumeResponse, error)
func (*Rf1Querier) WithPatternQuerier ¶
func (q *Rf1Querier) WithPatternQuerier(pq querier.PatterQuerier)
type Store ¶
type Store interface { storage.SelectStore index.BaseReader index.StatsReader }
Store is the store interface we need on the querier.
type TimeRangeLimits ¶
type TimeRangeLimits querier_limits.TimeRangeLimits