TSDB/query-planning-groundwork (#6367)

* begins building queryrange compatible types for index sampling

* adds MatcherGroups() method to SampleExpr

* MatcherGroups test + ShardResolver interface

* index stats codec wiring

* millisecond precision on index stats codec

* lint

* cleanMatchers in tsdb.IndexClient for consistency + adds catchall matcher if nil
pull/6492/head
Owen Diehl 4 years ago committed by GitHub
parent 67ebb0430b
commit 9218e4654b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      pkg/loghttp/query.go
  2. 61
      pkg/logql/shardmapper.go
  3. 4
      pkg/logql/shardmapper_test.go
  4. 36
      pkg/logql/syntax/ast.go
  5. 29
      pkg/logql/syntax/ast_test.go
  6. 4
      pkg/logql/syntax/parser.go
  7. 5
      pkg/querier/http.go
  8. 45
      pkg/querier/queryrange/codec.go
  9. 57
      pkg/querier/queryrange/codec_test.go
  10. 8
      pkg/querier/queryrange/extensions.go
  11. 412
      pkg/querier/queryrange/queryrange.pb.go
  12. 9
      pkg/querier/queryrange/queryrange.proto
  13. 3
      pkg/querier/queryrange/roundtrip.go
  14. 59
      pkg/storage/stores/shipper/indexgateway/indexgatewaypb/compat.go
  15. 117
      pkg/storage/stores/shipper/indexgateway/indexgatewaypb/gateway.pb.go
  16. 2
      pkg/storage/stores/shipper/indexgateway/indexgatewaypb/gateway.proto
  17. 23
      pkg/storage/stores/tsdb/index_client.go

@ -337,3 +337,9 @@ func ParseRangeQuery(r *http.Request) (*RangeQuery, error) {
return &result, nil
}
func ParseIndexStatsQuery(r *http.Request) (*RangeQuery, error) {
// TODO(owen-d): use a specific type/validation instead
// of using range query parameters (superset)
return ParseRangeQuery(r)
}

@ -12,8 +12,16 @@ import (
util_log "github.com/grafana/loki/pkg/util/log"
)
type ShardResolver interface {
Shards(expr syntax.Expr) (int, error)
}
type constantShards int
func (s constantShards) Shards(_ syntax.Expr) (int, error) { return int(s), nil }
type ShardMapper struct {
shards int
shards constantShards
metrics *MapperMetrics
}
@ -22,7 +30,7 @@ func NewShardMapper(shards int, metrics *MapperMetrics) (ShardMapper, error) {
return ShardMapper{}, fmt.Errorf("cannot create ShardMapper with <2 shards. Received %d", shards)
}
return ShardMapper{
shards: shards,
shards: constantShards(shards),
metrics: metrics,
}, nil
}
@ -70,13 +78,13 @@ func (m ShardMapper) Map(expr syntax.Expr, r *downstreamRecorder) (syntax.Expr,
case *syntax.LiteralExpr:
return e, nil
case *syntax.MatchersExpr, *syntax.PipelineExpr:
return m.mapLogSelectorExpr(e.(syntax.LogSelectorExpr), r), nil
return m.mapLogSelectorExpr(e.(syntax.LogSelectorExpr), r)
case *syntax.VectorAggregationExpr:
return m.mapVectorAggregationExpr(e, r)
case *syntax.LabelReplaceExpr:
return m.mapLabelReplaceExpr(e, r)
case *syntax.RangeAggregationExpr:
return m.mapRangeAggregationExpr(e, r), nil
return m.mapRangeAggregationExpr(e, r)
case *syntax.BinOpExpr:
lhsMapped, err := m.Map(e.SampleExpr, r)
if err != nil {
@ -102,42 +110,50 @@ func (m ShardMapper) Map(expr syntax.Expr, r *downstreamRecorder) (syntax.Expr,
}
}
func (m ShardMapper) mapLogSelectorExpr(expr syntax.LogSelectorExpr, r *downstreamRecorder) syntax.LogSelectorExpr {
func (m ShardMapper) mapLogSelectorExpr(expr syntax.LogSelectorExpr, r *downstreamRecorder) (syntax.LogSelectorExpr, error) {
var head *ConcatLogSelectorExpr
for i := m.shards - 1; i >= 0; i-- {
shards, err := m.shards.Shards(expr)
if err != nil {
return nil, err
}
for i := shards - 1; i >= 0; i-- {
head = &ConcatLogSelectorExpr{
DownstreamLogSelectorExpr: DownstreamLogSelectorExpr{
shard: &astmapper.ShardAnnotation{
Shard: i,
Of: m.shards,
Of: shards,
},
LogSelectorExpr: expr,
},
next: head,
}
}
r.Add(m.shards, StreamsKey)
r.Add(shards, StreamsKey)
return head
return head, nil
}
func (m ShardMapper) mapSampleExpr(expr syntax.SampleExpr, r *downstreamRecorder) syntax.SampleExpr {
func (m ShardMapper) mapSampleExpr(expr syntax.SampleExpr, r *downstreamRecorder) (syntax.SampleExpr, error) {
var head *ConcatSampleExpr
for i := m.shards - 1; i >= 0; i-- {
shards, err := m.shards.Shards(expr)
if err != nil {
return nil, err
}
for i := shards - 1; i >= 0; i-- {
head = &ConcatSampleExpr{
DownstreamSampleExpr: DownstreamSampleExpr{
shard: &astmapper.ShardAnnotation{
Shard: i,
Of: m.shards,
Of: shards,
},
SampleExpr: expr,
},
next: head,
}
}
r.Add(m.shards, MetricsKey)
r.Add(shards, MetricsKey)
return head
return head, nil
}
// technically, std{dev,var} are also parallelizable if there is no cross-shard merging
@ -167,8 +183,12 @@ func (m ShardMapper) mapVectorAggregationExpr(expr *syntax.VectorAggregationExpr
switch expr.Operation {
case syntax.OpTypeSum:
// sum(x) -> sum(sum(x, shard=1) ++ sum(x, shard=2)...)
sharded, err := m.mapSampleExpr(expr, r)
if err != nil {
return nil, err
}
return &syntax.VectorAggregationExpr{
Left: m.mapSampleExpr(expr, r),
Left: sharded,
Grouping: expr.Grouping,
Params: expr.Params,
Operation: expr.Operation,
@ -201,7 +221,10 @@ func (m ShardMapper) mapVectorAggregationExpr(expr *syntax.VectorAggregationExpr
case syntax.OpTypeCount:
// count(x) -> sum(count(x, shard=1) ++ count(x, shard=2)...)
sharded := m.mapSampleExpr(expr, r)
sharded, err := m.mapSampleExpr(expr, r)
if err != nil {
return nil, err
}
return &syntax.VectorAggregationExpr{
Left: sharded,
Grouping: expr.Grouping,
@ -228,13 +251,13 @@ func (m ShardMapper) mapLabelReplaceExpr(expr *syntax.LabelReplaceExpr, r *downs
return &cpy, nil
}
func (m ShardMapper) mapRangeAggregationExpr(expr *syntax.RangeAggregationExpr, r *downstreamRecorder) syntax.SampleExpr {
func (m ShardMapper) mapRangeAggregationExpr(expr *syntax.RangeAggregationExpr, r *downstreamRecorder) (syntax.SampleExpr, error) {
if hasLabelModifier(expr) {
// if an expr can modify labels this means multiple shards can return the same labelset.
// When this happens the merge strategy needs to be different from a simple concatenation.
// For instance for rates we need to sum data from different shards but same series.
// Since we currently support only concatenation as merge strategy, we skip those queries.
return expr
return expr, nil
}
switch expr.Operation {
case syntax.OpRangeTypeCount, syntax.OpRangeTypeRate, syntax.OpRangeTypeBytesRate, syntax.OpRangeTypeBytes:
@ -243,7 +266,7 @@ func (m ShardMapper) mapRangeAggregationExpr(expr *syntax.RangeAggregationExpr,
// same goes for bytes_rate and bytes_over_time
return m.mapSampleExpr(expr, r)
default:
return expr
return expr, nil
}
}

@ -106,7 +106,9 @@ func TestMapSampleExpr(t *testing.T) {
},
} {
t.Run(tc.in.String(), func(t *testing.T) {
require.Equal(t, tc.out, m.mapSampleExpr(tc.in, nilShardMetrics.downstreamRecorder()))
mapped, err := m.mapSampleExpr(tc.in, nilShardMetrics.downstreamRecorder())
require.Nil(t, err)
require.Equal(t, tc.out, mapped)
})
}
}

@ -707,6 +707,7 @@ type SampleExpr interface {
// Selector is the LogQL selector to apply when retrieving logs.
Selector() LogSelectorExpr
Extractor() (SampleExtractor, error)
MatcherGroups() [][]*labels.Matcher
Expr
}
@ -753,6 +754,14 @@ func (e *RangeAggregationExpr) Selector() LogSelectorExpr {
return e.Left.Left
}
func (e *RangeAggregationExpr) MatcherGroups() [][]*labels.Matcher {
xs := e.Left.Left.Matchers()
if len(xs) > 0 {
return [][]*labels.Matcher{xs}
}
return nil
}
func (e RangeAggregationExpr) validate() error {
if e.Grouping != nil {
switch e.Operation {
@ -871,6 +880,10 @@ func mustNewVectorAggregationExpr(left SampleExpr, operation string, gr *Groupin
}
}
func (e *VectorAggregationExpr) MatcherGroups() [][]*labels.Matcher {
return e.Left.MatcherGroups()
}
func (e *VectorAggregationExpr) Selector() LogSelectorExpr {
return e.Left.Selector()
}
@ -992,6 +1005,10 @@ type BinOpExpr struct {
Opts *BinOpOptions
}
func (e *BinOpExpr) MatcherGroups() [][]*labels.Matcher {
return append(e.SampleExpr.MatcherGroups(), e.RHS.MatcherGroups()...)
}
func (e *BinOpExpr) String() string {
op := e.Op
if e.Opts != nil {
@ -1374,6 +1391,7 @@ func (e *LiteralExpr) Shardable() bool { return true }
func (e *LiteralExpr) Walk(f WalkFn) { f(e) }
func (e *LiteralExpr) Pipeline() (log.Pipeline, error) { return log.NewNoopPipeline(), nil }
func (e *LiteralExpr) Matchers() []*labels.Matcher { return nil }
func (e *LiteralExpr) MatcherGroups() [][]*labels.Matcher { return nil }
func (e *LiteralExpr) Extractor() (log.SampleExtractor, error) { return nil, nil }
func (e *LiteralExpr) Value() float64 { return e.Val }
@ -1428,6 +1446,10 @@ func (e *LabelReplaceExpr) Selector() LogSelectorExpr {
return e.Left.Selector()
}
func (e *LabelReplaceExpr) MatcherGroups() [][]*labels.Matcher {
return e.Left.MatcherGroups()
}
func (e *LabelReplaceExpr) Extractor() (SampleExtractor, error) {
return e.Left.Extractor()
}
@ -1498,3 +1520,17 @@ var shardableOps = map[string]bool{
OpTypeAdd: true,
OpTypeMul: true,
}
func MatcherGroups(expr Expr) [][]*labels.Matcher {
switch e := expr.(type) {
case SampleExpr:
return e.MatcherGroups()
case LogSelectorExpr:
if xs := e.Matchers(); len(xs) > 0 {
return [][]*labels.Matcher{xs}
}
return nil
default:
return nil
}
}

@ -1,6 +1,7 @@
package syntax
import (
"fmt"
"testing"
"github.com/prometheus/prometheus/model/labels"
@ -178,6 +179,34 @@ func Test_SampleExpr_String(t *testing.T) {
}
}
func TestMatcherGroups(t *testing.T) {
for i, tc := range []struct {
query string
exp [][]*labels.Matcher
}{
{
query: `{job="foo"}`,
exp: [][]*labels.Matcher{
{labels.MustNewMatcher(labels.MatchEqual, "job", "foo")},
},
},
{
query: `count_over_time({job="foo"}[5m]) / count_over_time({job="bar"}[5m])`,
exp: [][]*labels.Matcher{
{labels.MustNewMatcher(labels.MatchEqual, "job", "foo")},
{labels.MustNewMatcher(labels.MatchEqual, "job", "bar")},
},
},
} {
t.Run(fmt.Sprint(i), func(t *testing.T) {
expr, err := ParseExpr(tc.query)
require.Nil(t, err)
out := MatcherGroups(expr)
require.Equal(t, tc.exp, out)
})
}
}
func Test_NilFilterDoesntPanic(t *testing.T) {
t.Parallel()
for _, tc := range []string{

@ -145,6 +145,10 @@ func ParseMatchers(input string) ([]*labels.Matcher, error) {
return matcherExpr.Mts, nil
}
func MatchersString(xs []*labels.Matcher) string {
return newMatcherExpr(xs).String()
}
// ParseSampleExpr parses a string and returns the sampleExpr
func ParseSampleExpr(input string) (SampleExpr, error) {
expr, err := ParseExpr(input)

@ -422,9 +422,8 @@ func (q *QuerierAPI) SeriesHandler(w http.ResponseWriter, r *http.Request) {
// IndexStatsHandler queries the index for the data statistics related to a query
func (q *QuerierAPI) IndexStatsHandler(w http.ResponseWriter, r *http.Request) {
// TODO(owen-d): use a specific type/validation instead
// of using range query parameters (superset)
req, err := loghttp.ParseRangeQuery(r)
req, err := loghttp.ParseIndexStatsQuery(r)
if err != nil {
serverutil.WriteError(httpgrpc.Errorf(http.StatusBadRequest, err.Error()), w)
return

@ -26,6 +26,8 @@ import (
"github.com/grafana/loki/pkg/logqlmodel"
"github.com/grafana/loki/pkg/logqlmodel/stats"
"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb"
"github.com/grafana/loki/pkg/util"
"github.com/grafana/loki/pkg/util/httpreq"
"github.com/grafana/loki/pkg/util/marshal"
marshal_legacy "github.com/grafana/loki/pkg/util/marshal/legacy"
@ -259,6 +261,17 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, forwardHeaders []
EndTs: *req.End,
Path: r.URL.Path,
}, nil
case IndexStatsOp:
req, err := loghttp.ParseIndexStatsQuery(r)
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
}
from, through := util.RoundToMilliseconds(req.Start, req.End)
return &indexgatewaypb.IndexStatsRequest{
From: from,
Through: through,
Matchers: req.Query,
}, err
default:
return nil, httpgrpc.Errorf(http.StatusBadRequest, fmt.Sprintf("unknown request path: %s", r.URL.Path))
}
@ -365,6 +378,24 @@ func (Codec) EncodeRequest(ctx context.Context, r queryrangebase.Request) (*http
Header: header,
}
return req.WithContext(ctx), nil
case *indexgatewaypb.IndexStatsRequest:
params := url.Values{
"start": []string{fmt.Sprintf("%d", request.From.Time().UnixNano())},
"end": []string{fmt.Sprintf("%d", request.Through.Time().UnixNano())},
"query": []string{request.GetQuery()},
}
u := &url.URL{
Path: "/loki/api/v1/index/stats",
RawQuery: params.Encode(),
}
req := &http.Request{
Method: "GET",
RequestURI: u.String(), // This is what the httpgrpc code looks at.
URL: u,
Body: http.NoBody,
Header: header,
}
return req.WithContext(ctx), nil
default:
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "invalid request format")
@ -424,6 +455,15 @@ func (Codec) DecodeResponse(ctx context.Context, r *http.Response, req queryrang
Data: resp.Data,
Headers: httpResponseHeadersToPromResponseHeaders(r.Header),
}, nil
case *indexgatewaypb.IndexStatsRequest:
var resp indexgatewaypb.IndexStatsResponse
if err := json.Unmarshal(buf, &resp); err != nil {
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "error decoding response: %v", err)
}
return &IndexStatsResponse{
Response: &resp,
Headers: httpResponseHeadersToPromResponseHeaders(r.Header),
}, nil
default:
var resp loghttp.QueryResponse
if err := resp.UnmarshalJSON(buf); err != nil {
@ -536,6 +576,11 @@ func (Codec) EncodeResponse(ctx context.Context, res queryrangebase.Response) (*
return nil, err
}
}
case *IndexStatsResponse:
if err := marshal.WriteIndexStatsResponseJSON(response.Response, &buf); err != nil {
return nil, err
}
default:
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "invalid response format")
}

@ -12,12 +12,15 @@ import (
"testing"
"time"
"github.com/prometheus/common/model"
"github.com/stretchr/testify/require"
"github.com/grafana/loki/pkg/loghttp"
"github.com/grafana/loki/pkg/logproto"
"github.com/grafana/loki/pkg/logqlmodel/stats"
"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase"
"github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb"
"github.com/grafana/loki/pkg/util"
)
func init() {
@ -79,6 +82,17 @@ func Test_codec_DecodeRequest(t *testing.T) {
StartTs: start,
EndTs: end,
}, false},
{"index_stats", func() (*http.Request, error) {
return LokiCodec.EncodeRequest(context.Background(), &indexgatewaypb.IndexStatsRequest{
From: model.TimeFromUnixNano(start.UnixNano()),
Through: model.TimeFromUnixNano(end.UnixNano()),
Matchers: `{job="foo"}`,
})
}, &indexgatewaypb.IndexStatsRequest{
From: model.TimeFromUnixNano(start.UnixNano()),
Through: model.TimeFromUnixNano(end.UnixNano()),
Matchers: `{job="foo"}`,
}, false},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -200,6 +214,18 @@ func Test_codec_DecodeResponse(t *testing.T) {
Data: labelsData,
}, false,
},
{
"index stats", &http.Response{StatusCode: 200, Body: ioutil.NopCloser(strings.NewReader(indexStatsString))},
&indexgatewaypb.IndexStatsRequest{},
&IndexStatsResponse{
Response: &indexgatewaypb.IndexStatsResponse{
Streams: 1,
Chunks: 2,
Bytes: 3,
Entries: 4,
},
}, false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -326,6 +352,20 @@ func Test_codec_labels_EncodeRequest(t *testing.T) {
require.Equal(t, "/loki/api/v1/labels/__name__/values", req.(*LokiLabelNamesRequest).Path)
}
func Test_codec_index_stats_EncodeRequest(t *testing.T) {
from, through := util.RoundToMilliseconds(start, end)
toEncode := &indexgatewaypb.IndexStatsRequest{
From: from,
Through: through,
Matchers: `{job="foo"}`,
}
got, err := LokiCodec.EncodeRequest(context.Background(), toEncode)
require.Nil(t, err)
require.Equal(t, fmt.Sprintf("%d", from.UnixNano()), got.URL.Query().Get("start"))
require.Equal(t, fmt.Sprintf("%d", through.UnixNano()), got.URL.Query().Get("end"))
require.Equal(t, `{job="foo"}`, got.URL.Query().Get("query"))
}
func Test_codec_EncodeResponse(t *testing.T) {
tests := []struct {
name string
@ -396,6 +436,17 @@ func Test_codec_EncodeResponse(t *testing.T) {
Data: labelsData,
}, labelsLegacyString, false,
},
{
"index stats",
&IndexStatsResponse{
Response: &indexgatewaypb.IndexStatsResponse{
Streams: 1,
Chunks: 2,
Bytes: 3,
Entries: 4,
},
}, indexStatsString, false,
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
@ -1103,6 +1154,12 @@ var (
"bar"
]
}`
indexStatsString = `{
"streams": 1,
"chunks": 2,
"bytes": 3,
"entries": 4
}`
labelsData = []string{"foo", "bar"}
statsResult = stats.Result{
Summary: stats.Summary{

@ -53,3 +53,11 @@ func convertPrometheusResponseHeadersToPointers(h []queryrangebase.PrometheusRes
return resp
}
// GetHeaders returns the HTTP headers in the response.
func (m *IndexStatsResponse) GetHeaders() []*queryrangebase.PrometheusResponseHeader {
if m != nil {
return convertPrometheusResponseHeadersToPointers(m.Headers)
}
return nil
}

@ -14,6 +14,8 @@ import (
stats "github.com/grafana/loki/pkg/logqlmodel/stats"
github_com_grafana_loki_pkg_querier_queryrange_queryrangebase "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase"
queryrangebase "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase"
_ "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb"
github_com_grafana_loki_pkg_storage_stores_shipper_indexgateway_indexgatewaypb "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb"
io "io"
math "math"
math_bits "math/bits"
@ -690,6 +692,43 @@ func (m *LokiPromResponse) GetStatistics() stats.Result {
return stats.Result{}
}
type IndexStatsResponse struct {
Response *github_com_grafana_loki_pkg_storage_stores_shipper_indexgateway_indexgatewaypb.IndexStatsResponse `protobuf:"bytes,1,opt,name=response,proto3,customtype=github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb.IndexStatsResponse" json:"response,omitempty"`
Headers []github_com_grafana_loki_pkg_querier_queryrange_queryrangebase.PrometheusResponseHeader `protobuf:"bytes,2,rep,name=Headers,proto3,customtype=github.com/grafana/loki/pkg/querier/queryrange/queryrangebase.PrometheusResponseHeader" json:"-"`
}
func (m *IndexStatsResponse) Reset() { *m = IndexStatsResponse{} }
func (*IndexStatsResponse) ProtoMessage() {}
func (*IndexStatsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{9}
}
func (m *IndexStatsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *IndexStatsResponse) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_IndexStatsResponse.Marshal(b, m, deterministic)
} else {
b = b[:cap(b)]
n, err := m.MarshalToSizedBuffer(b)
if err != nil {
return nil, err
}
return b[:n], nil
}
}
func (m *IndexStatsResponse) XXX_Merge(src proto.Message) {
xxx_messageInfo_IndexStatsResponse.Merge(m, src)
}
func (m *IndexStatsResponse) XXX_Size() int {
return m.Size()
}
func (m *IndexStatsResponse) XXX_DiscardUnknown() {
xxx_messageInfo_IndexStatsResponse.DiscardUnknown(m)
}
var xxx_messageInfo_IndexStatsResponse proto.InternalMessageInfo
func init() {
proto.RegisterType((*LokiRequest)(nil), "queryrange.LokiRequest")
proto.RegisterType((*LokiInstantRequest)(nil), "queryrange.LokiInstantRequest")
@ -700,6 +739,7 @@ func init() {
proto.RegisterType((*LokiLabelNamesResponse)(nil), "queryrange.LokiLabelNamesResponse")
proto.RegisterType((*LokiData)(nil), "queryrange.LokiData")
proto.RegisterType((*LokiPromResponse)(nil), "queryrange.LokiPromResponse")
proto.RegisterType((*IndexStatsResponse)(nil), "queryrange.IndexStatsResponse")
}
func init() {
@ -707,65 +747,70 @@ func init() {
}
var fileDescriptor_51b9d53b40d11902 = []byte{
// 923 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x55, 0xcf, 0x6f, 0x23, 0x35,
0x14, 0x8e, 0x33, 0xf9, 0x35, 0x2e, 0x5b, 0xc0, 0x5d, 0x76, 0x47, 0x45, 0x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x7e, 0x37, 0x25, 0x98, 0xcd, 0xb3, 0xa1, 0x51, 0x81, 0x52, 0xd8, 0xd0, 0x51, 0xe1,
0xce, 0xbb, 0x86, 0x3b, 0x05, 0x23, 0x38, 0x79, 0x30, 0xc4, 0x99, 0x20, 0x2c, 0xf8, 0x58, 0xde,
0xe2, 0x79, 0xee, 0xbd, 0xfd, 0x6f, 0xb4, 0x9c, 0xc3, 0xca, 0xb9, 0xea, 0xdf, 0x0d, 0x8b, 0x5f,
0xe9, 0x7c, 0x0f, 0xe0, 0x2b, 0xf2, 0xb2, 0x92, 0x9e, 0xb9, 0x20, 0x76, 0x61, 0x8b, 0x15, 0xeb,
0x42, 0xbc, 0x9d, 0xcb, 0x47, 0x15, 0xd4, 0x8e, 0x73, 0x0f, 0x84, 0x73, 0x24, 0xba, 0xbf, 0x44,
0x65, 0xf5, 0x22, 0x2a, 0x25, 0xa4, 0x62, 0x92, 0x17, 0xbc, 0x77, 0x72, 0xea, 0x56, 0x9e, 0x9d,
0xba, 0x95, 0x17, 0xa7, 0x2e, 0xf8, 0x76, 0xea, 0x82, 0x9f, 0xa7, 0x2e, 0x38, 0x9e, 0xba, 0xe0,
0x64, 0xea, 0x82, 0xdf, 0xa7, 0x2e, 0xf8, 0x73, 0xea, 0x56, 0x5e, 0x4c, 0x5d, 0xf0, 0xf4, 0xcc,
0xad, 0x9c, 0x9c, 0xb9, 0x95, 0x67, 0x67, 0x6e, 0x65, 0xd0, 0x50, 0x5d, 0xde, 0xff, 0x3b, 0x00,
0x00, 0xff, 0xff, 0x13, 0x18, 0x8f, 0x0c, 0x55, 0x0b, 0x00, 0x00,
// 1003 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x56, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xf7, 0xf8, 0x5f, 0xec, 0x09, 0x0d, 0x30, 0x29, 0xed, 0xca, 0x48, 0xbb, 0x96, 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0x3f, 0x31, 0xc1, 0x6f, 0x13, 0x13, 0x1c, 0x4d, 0x4c, 0x70,
0x3c, 0x31, 0xc1, 0x5f, 0x13, 0x13, 0xfc, 0x33, 0x31, 0x2b, 0x4f, 0x26, 0x26, 0x78, 0x74, 0x66,
0x56, 0x8e, 0xcf, 0xcc, 0xca, 0xe3, 0x33, 0xb3, 0x32, 0x6c, 0x4a, 0x29, 0xdd, 0xfd, 0x2f, 0x00,
0x00, 0xff, 0xff, 0x56, 0x94, 0x8e, 0x4e, 0x00, 0x0d, 0x00, 0x00,
}
func (this *LokiRequest) Equal(that interface{}) bool {
@ -1145,6 +1190,42 @@ func (this *LokiPromResponse) Equal(that interface{}) bool {
}
return true
}
func (this *IndexStatsResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*IndexStatsResponse)
if !ok {
that2, ok := that.(IndexStatsResponse)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if that1.Response == nil {
if this.Response != nil {
return false
}
} else if !this.Response.Equal(*that1.Response) {
return false
}
if len(this.Headers) != len(that1.Headers) {
return false
}
for i := range this.Headers {
if !this.Headers[i].Equal(that1.Headers[i]) {
return false
}
}
return true
}
func (this *LokiRequest) GoString() string {
if this == nil {
return "nil"
@ -1280,6 +1361,17 @@ func (this *LokiPromResponse) GoString() string {
s = append(s, "}")
return strings.Join(s, "")
}
func (this *IndexStatsResponse) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 6)
s = append(s, "&queryrange.IndexStatsResponse{")
s = append(s, "Response: "+fmt.Sprintf("%#v", this.Response)+",\n")
s = append(s, "Headers: "+fmt.Sprintf("%#v", this.Headers)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func valueToGoStringQueryrange(v interface{}, typ string) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@ -1867,6 +1959,55 @@ func (m *LokiPromResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *IndexStatsResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
n, err := m.MarshalToSizedBuffer(dAtA[:size])
if err != nil {
return nil, err
}
return dAtA[:n], nil
}
func (m *IndexStatsResponse) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *IndexStatsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Headers) > 0 {
for iNdEx := len(m.Headers) - 1; iNdEx >= 0; iNdEx-- {
{
size := m.Headers[iNdEx].Size()
i -= size
if _, err := m.Headers[iNdEx].MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintQueryrange(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0x12
}
}
if m.Response != nil {
{
size := m.Response.Size()
i -= size
if _, err := m.Response.MarshalTo(dAtA[i:]); err != nil {
return 0, err
}
i = encodeVarintQueryrange(dAtA, i, uint64(size))
}
i--
dAtA[i] = 0xa
}
return len(dAtA) - i, nil
}
func encodeVarintQueryrange(dAtA []byte, offset int, v uint64) int {
offset -= sovQueryrange(v)
base := offset
@ -2128,6 +2269,25 @@ func (m *LokiPromResponse) Size() (n int) {
return n
}
func (m *IndexStatsResponse) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
if m.Response != nil {
l = m.Response.Size()
n += 1 + l + sovQueryrange(uint64(l))
}
if len(m.Headers) > 0 {
for _, e := range m.Headers {
l = e.Size()
n += 1 + l + sovQueryrange(uint64(l))
}
}
return n
}
func sovQueryrange(x uint64) (n int) {
return (math_bits.Len64(x|1) + 6) / 7
}
@ -2266,6 +2426,17 @@ func (this *LokiPromResponse) String() string {
}, "")
return s
}
func (this *IndexStatsResponse) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&IndexStatsResponse{`,
`Response:` + fmt.Sprintf("%v", this.Response) + `,`,
`Headers:` + fmt.Sprintf("%v", this.Headers) + `,`,
`}`,
}, "")
return s
}
func valueToStringQueryrange(v interface{}) string {
rv := reflect.ValueOf(v)
if rv.IsNil() {
@ -4106,6 +4277,129 @@ func (m *LokiPromResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *IndexStatsResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0
for iNdEx < l {
preIndex := iNdEx
var wire uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQueryrange
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
wire |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
fieldNum := int32(wire >> 3)
wireType := int(wire & 0x7)
if wireType == 4 {
return fmt.Errorf("proto: IndexStatsResponse: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: IndexStatsResponse: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Response", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQueryrange
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthQueryrange
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQueryrange
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
if m.Response == nil {
m.Response = &github_com_grafana_loki_pkg_storage_stores_shipper_indexgateway_indexgatewaypb.IndexStatsResponse{}
}
if err := m.Response.Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Headers", wireType)
}
var msglen int
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQueryrange
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
msglen |= int(b&0x7F) << shift
if b < 0x80 {
break
}
}
if msglen < 0 {
return ErrInvalidLengthQueryrange
}
postIndex := iNdEx + msglen
if postIndex < 0 {
return ErrInvalidLengthQueryrange
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Headers = append(m.Headers, github_com_grafana_loki_pkg_querier_queryrange_queryrangebase.PrometheusResponseHeader{})
if err := m.Headers[len(m.Headers)-1].Unmarshal(dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
default:
iNdEx = preIndex
skippy, err := skipQueryrange(dAtA[iNdEx:])
if err != nil {
return err
}
if skippy < 0 {
return ErrInvalidLengthQueryrange
}
if (iNdEx + skippy) < 0 {
return ErrInvalidLengthQueryrange
}
if (iNdEx + skippy) > l {
return io.ErrUnexpectedEOF
}
iNdEx += skippy
}
}
if iNdEx > l {
return io.ErrUnexpectedEOF
}
return nil
}
func skipQueryrange(dAtA []byte) (n int, err error) {
l := len(dAtA)
iNdEx := 0

@ -7,6 +7,7 @@ import "google/protobuf/timestamp.proto";
import "pkg/logproto/logproto.proto";
import "pkg/logqlmodel/stats/stats.proto";
import "pkg/querier/queryrange/queryrangebase/queryrange.proto";
import "pkg/storage/stores/shipper/indexgateway/indexgatewaypb/gateway.proto";
option (gogoproto.marshaler_all) = true;
option (gogoproto.unmarshaler_all) = true;
@ -133,3 +134,11 @@ message LokiPromResponse {
queryrangebase.PrometheusResponse response = 1 [(gogoproto.nullable) = true];
stats.Result statistics = 2 [(gogoproto.nullable) = false];
}
message IndexStatsResponse {
indexgatewaypb.IndexStatsResponse response = 1 [(gogoproto.customtype) = "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb.IndexStatsResponse"];
repeated queryrangebase.PrometheusResponseHeader Headers = 2 [
(gogoproto.jsontag) = "-",
(gogoproto.customtype) = "github.com/grafana/loki/pkg/querier/queryrange/queryrangebase.PrometheusResponseHeader"
];
}

@ -225,6 +225,7 @@ const (
QueryRangeOp = "query_range"
SeriesOp = "series"
LabelNamesOp = "labels"
IndexStatsOp = "index_stats"
)
func getOperation(path string) string {
@ -237,6 +238,8 @@ func getOperation(path string) string {
return LabelNamesOp
case strings.HasSuffix(path, "/v1/query"):
return InstantQueryOp
case path == "/loki/api/v1/index/stats":
return IndexStatsOp
default:
return ""
}

@ -0,0 +1,59 @@
package indexgatewaypb
import (
"time"
"github.com/opentracing/opentracing-go"
otlog "github.com/opentracing/opentracing-go/log"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/timestamp"
"github.com/grafana/loki/pkg/querier/queryrange/queryrangebase"
)
// Satisfy queryrangebase.Request
// GetStart returns the start timestamp of the request in milliseconds.
func (m *IndexStatsRequest) GetStart() int64 {
return m.From.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}
// GetEnd returns the end timestamp of the request in milliseconds.
func (m *IndexStatsRequest) GetEnd() int64 {
return m.Through.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}
// GetStep returns the step of the request in milliseconds.
func (m *IndexStatsRequest) GetStep() int64 { return 0 }
// GetQuery returns the query of the request.
func (m *IndexStatsRequest) GetQuery() string {
return m.Matchers
}
// GetCachingOptions returns the caching options.
func (m *IndexStatsRequest) GetCachingOptions() (res queryrangebase.CachingOptions) { return }
// WithStartEnd clone the current request with different start and end timestamp.
func (m *IndexStatsRequest) WithStartEnd(startTime int64, endTime int64) queryrangebase.Request {
new := *m
new.From = model.TimeFromUnixNano(startTime * int64(time.Millisecond))
new.Through = model.TimeFromUnixNano(endTime * int64(time.Millisecond))
return &new
}
// WithQuery clone the current request with a different query.
func (m *IndexStatsRequest) WithQuery(query string) queryrangebase.Request {
new := *m
new.Matchers = query
return &new
}
// LogToSpan writes information about this request to an OpenTracing span
func (m *IndexStatsRequest) LogToSpan(sp opentracing.Span) {
sp.LogFields(
otlog.String("query", m.GetQuery()),
otlog.String("start", timestamp.Time(m.GetStart()).String()),
otlog.String("end", timestamp.Time(m.GetEnd()).String()),
)
}

@ -748,65 +748,66 @@ func init() {
}
var fileDescriptor_33a7bd4603d312b2 = []byte{
// 920 bytes of a gzipped FileDescriptorProto
// 931 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x56, 0x4f, 0x6f, 0x1b, 0x45,
0x14, 0xf7, 0xd8, 0x5b, 0x27, 0x7e, 0x31, 0xd0, 0x4e, 0x51, 0xb1, 0x0c, 0x5d, 0xa7, 0x8b, 0x20,
0x11, 0x12, 0x5e, 0x28, 0xb9, 0x20, 0xc4, 0x01, 0x17, 0x88, 0x22, 0x4a, 0x55, 0x26, 0x50, 0xc1,
0x09, 0x8d, 0x9d, 0xf1, 0xee, 0x92, 0x5d, 0xcf, 0x76, 0x76, 0x96, 0x34, 0x37, 0xbe, 0x00, 0x12,
0xdf, 0x02, 0x3e, 0x05, 0x20, 0x4e, 0x3d, 0x86, 0x5b, 0xc5, 0xc1, 0x22, 0xce, 0x05, 0xe5, 0xd4,
0x8f, 0x80, 0xf6, 0xed, 0x5f, 0xdb, 0x49, 0x90, 0x4a, 0x2e, 0x3d, 0xed, 0xbc, 0xdf, 0x7b, 0x6f,
0xe6, 0xf7, 0x9b, 0x79, 0xf3, 0x66, 0xe1, 0xe3, 0x70, 0xdf, 0xb1, 0x23, 0x2d, 0x15, 0x77, 0x04,
0x7e, 0x45, 0x64, 0x47, 0xae, 0x17, 0x86, 0x42, 0xd9, 0xde, 0x64, 0x4f, 0x3c, 0x72, 0xb8, 0x16,
0x07, 0xfc, 0x70, 0xce, 0x08, 0x87, 0x76, 0x36, 0xea, 0x87, 0x4a, 0x6a, 0x49, 0x5f, 0x9c, 0xf7,
0x76, 0xdf, 0x76, 0x3c, 0xed, 0xc6, 0xc3, 0xfe, 0x48, 0x06, 0xb6, 0x23, 0x1d, 0x69, 0x63, 0xd8,
0x30, 0x1e, 0xa3, 0x85, 0x06, 0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50, 0xba, 0xff, 0xce, 0xbf, 0x01, 0x00, 0x00, 0xff, 0xff, 0x32, 0x10, 0x4c, 0x62, 0x13,
0x0b, 0x00, 0x00,
}
func (this *LabelValuesForMetricNameRequest) Equal(that interface{}) bool {

@ -5,6 +5,8 @@ package indexgatewaypb;
import "github.com/gogo/protobuf/gogoproto/gogo.proto";
import "pkg/logproto/logproto.proto";
option go_package = "github.com/grafana/loki/pkg/storage/stores/shipper/indexgateway/indexgatewaypb";
service IndexGateway {
/// QueryIndex reads the indexes required for given query & sends back the batch of rows
/// in rpc streams

@ -30,7 +30,9 @@ func NewIndexClient(idx Index) *IndexClient {
// In the future, we should use dynamic sharding in TSDB to determine the shard factors
// and we may no longer wish to send a shard label inside the queries,
// but rather expose it as part of the stores.Index interface
func (c *IndexClient) shard(matchers ...*labels.Matcher) ([]*labels.Matcher, *index.ShardAnnotation, error) {
func cleanMatchers(matchers ...*labels.Matcher) ([]*labels.Matcher, *index.ShardAnnotation, error) {
// first use withoutNameLabel to make a copy with the name label removed
matchers = withoutNameLabel(matchers)
s, shardLabelIndex, err := astmapper.ShardFromMatchers(matchers)
if err != nil {
return nil, nil, err
@ -45,6 +47,11 @@ func (c *IndexClient) shard(matchers ...*labels.Matcher) ([]*labels.Matcher, *in
}
}
if len(matchers) == 0 {
// hack to query all data
matchers = append(matchers, labels.MustNewMatcher(labels.MatchEqual, "", ""))
}
return matchers, shard, err
}
@ -53,8 +60,7 @@ func (c *IndexClient) shard(matchers ...*labels.Matcher) ([]*labels.Matcher, *in
// They share almost the same fields, so we can add the missing `KB` field to the proto and then
// use that within the tsdb package.
func (c *IndexClient) GetChunkRefs(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]logproto.ChunkRef, error) {
matchers = withoutNameLabel(matchers)
matchers, shard, err := c.shard(matchers...)
matchers, shard, err := cleanMatchers(matchers...)
if err != nil {
return nil, err
}
@ -80,8 +86,7 @@ func (c *IndexClient) GetChunkRefs(ctx context.Context, userID string, from, thr
}
func (c *IndexClient) GetSeries(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) ([]labels.Labels, error) {
matchers = withoutNameLabel(matchers)
matchers, shard, err := c.shard(matchers...)
matchers, shard, err := cleanMatchers(matchers...)
if err != nil {
return nil, err
}
@ -100,7 +105,10 @@ func (c *IndexClient) GetSeries(ctx context.Context, userID string, from, throug
// tsdb no longer uses the __metric_name__="logs" hack, so we can ignore metric names!
func (c *IndexClient) LabelValuesForMetricName(ctx context.Context, userID string, from, through model.Time, _ string, labelName string, matchers ...*labels.Matcher) ([]string, error) {
matchers = withoutNameLabel(matchers)
matchers, _, err := cleanMatchers(matchers...)
if err != nil {
return nil, err
}
return c.idx.LabelValues(ctx, userID, from, through, labelName, matchers...)
}
@ -110,8 +118,7 @@ func (c *IndexClient) LabelNamesForMetricName(ctx context.Context, userID string
}
func (c *IndexClient) Stats(ctx context.Context, userID string, from, through model.Time, matchers ...*labels.Matcher) (*stats.Stats, error) {
matchers = withoutNameLabel(matchers)
matchers, shard, err := c.shard(matchers...)
matchers, shard, err := cleanMatchers(matchers...)
if err != nil {
return nil, err
}

Loading…
Cancel
Save