Replace `LokiLabelNamesRequest` with `logproto.LabelRequest`. (#10801)

**What this PR does / why we need it**:
This is an attempt to unify our API models and use the definitions in
`logproto` which is helpful for #10688.

**Checklist**
- [ ] Reviewed the
[`CONTRIBUTING.md`](https://github.com/grafana/loki/blob/main/CONTRIBUTING.md)
guide (**required**)
- [ ] Documentation added
- [ ] Tests updated
- [ ] `CHANGELOG.md` updated
- [ ] If the change is worth mentioning in the release notes, add
`add-to-release-notes` label
- [ ] Changes that require user attention or interaction to upgrade are
documented in `docs/sources/setup/upgrade/_index.md`
- [ ] For Helm chart changes bump the Helm chart version in
`production/helm/loki/Chart.yaml` and update
`production/helm/loki/CHANGELOG.md` and
`production/helm/loki/README.md`. [Example
PR](d10549e3ec)
pull/10868/head
Karsten Jeschkies 3 years ago committed by GitHub
parent d1dee9150b
commit 56437fa0c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 122
      pkg/querier/queryrange/codec.go
  2. 66
      pkg/querier/queryrange/codec_test.go
  3. 562
      pkg/querier/queryrange/queryrange.pb.go
  4. 13
      pkg/querier/queryrange/queryrange.proto
  5. 12
      pkg/querier/queryrange/roundtrip_test.go
  6. 13
      pkg/querier/queryrange/split_by_interval.go
  7. 6
      pkg/querier/queryrange/split_by_interval_test.go
  8. 24
      pkg/querier/queryrange/stats.go

@ -173,38 +173,76 @@ func (r *LokiSeriesRequest) LogToSpan(sp opentracing.Span) {
func (*LokiSeriesRequest) GetCachingOptions() (res queryrangebase.CachingOptions) { return }
func (r *LokiLabelNamesRequest) GetEnd() int64 {
return r.EndTs.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
// In some other world LabelRequest could implement queryrangebase.Request.
type LabelRequest struct {
path string
logproto.LabelRequest
}
func NewLabelRequest(start, end time.Time, query, name, path string) *LabelRequest {
return &LabelRequest{
LabelRequest: logproto.LabelRequest{
Start: &start,
End: &end,
Query: query,
Name: name,
Values: name != "",
},
path: path,
}
}
func (r *LokiLabelNamesRequest) GetStart() int64 {
return r.StartTs.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
func (r *LabelRequest) AsProto() *logproto.LabelRequest {
return &r.LabelRequest
}
func (r *LokiLabelNamesRequest) WithStartEnd(s int64, e int64) queryrangebase.Request {
clone := *r
clone.StartTs = time.Unix(0, s*int64(time.Millisecond))
clone.EndTs = time.Unix(0, e*int64(time.Millisecond))
return &clone
func (r *LabelRequest) GetEnd() int64 {
return r.End.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}
func (r *LabelRequest) GetEndTs() time.Time {
return *r.End
}
func (r *LabelRequest) GetStart() int64 {
return r.Start.UnixNano() / (int64(time.Millisecond) / int64(time.Nanosecond))
}
func (r *LabelRequest) GetStartTs() time.Time {
return *r.Start
}
func (r *LabelRequest) GetStep() int64 {
return 0
}
func (r *LokiLabelNamesRequest) WithQuery(_ string) queryrangebase.Request {
func (r *LabelRequest) WithStartEnd(s int64, e int64) queryrangebase.Request {
clone := *r
tmp := time.Unix(0, s*int64(time.Millisecond))
clone.Start = &tmp
tmp = time.Unix(0, e*int64(time.Millisecond))
clone.End = &tmp
return &clone
}
func (r *LokiLabelNamesRequest) GetStep() int64 {
return 0
func (r *LabelRequest) WithQuery(query string) queryrangebase.Request {
clone := *r
clone.Query = query
return &clone
}
func (r *LokiLabelNamesRequest) LogToSpan(sp opentracing.Span) {
func (r *LabelRequest) LogToSpan(sp opentracing.Span) {
sp.LogFields(
otlog.String("start", timestamp.Time(r.GetStart()).String()),
otlog.String("end", timestamp.Time(r.GetEnd()).String()),
)
}
func (*LokiLabelNamesRequest) GetCachingOptions() (res queryrangebase.CachingOptions) { return }
func (r *LabelRequest) Path() string {
return r.path
}
func (*LabelRequest) GetCachingOptions() (res queryrangebase.CachingOptions) { return }
func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (queryrangebase.Request, error) {
if err := r.ParseForm(); err != nil {
@ -258,11 +296,9 @@ func (Codec) DecodeRequest(_ context.Context, r *http.Request, _ []string) (quer
if err != nil {
return nil, httpgrpc.Errorf(http.StatusBadRequest, err.Error())
}
return &LokiLabelNamesRequest{
StartTs: *req.Start,
EndTs: *req.End,
Path: r.URL.Path,
Query: req.Query,
return &LabelRequest{
LabelRequest: *req,
path: r.URL.Path,
}, nil
case IndexStatsOp:
req, err := loghttp.ParseIndexStatsQuery(r)
@ -375,15 +411,15 @@ func (c Codec) EncodeRequest(ctx context.Context, r queryrangebase.Request) (*ht
Header: header,
}
return req.WithContext(ctx), nil
case *LokiLabelNamesRequest:
case *LabelRequest:
params := url.Values{
"start": []string{fmt.Sprintf("%d", request.StartTs.UnixNano())},
"end": []string{fmt.Sprintf("%d", request.EndTs.UnixNano())},
"start": []string{fmt.Sprintf("%d", request.Start.UnixNano())},
"end": []string{fmt.Sprintf("%d", request.End.UnixNano())},
"query": []string{request.GetQuery()},
}
u := &url.URL{
Path: request.Path, // NOTE: this could be either /label or /label/{name}/values endpoint. So forward the original path as it is.
Path: request.Path(), // NOTE: this could be either /label or /label/{name}/values endpoint. So forward the original path as it is.
RawQuery: params.Encode(),
}
req := &http.Request{
@ -537,14 +573,14 @@ func decodeResponseJSON(r *http.Response, req queryrangebase.Request) (queryrang
Data: data,
Headers: httpResponseHeadersToPromResponseHeaders(r.Header),
}, nil
case *LokiLabelNamesRequest:
case *LabelRequest:
var resp loghttp.LabelResponse
if err := json.Unmarshal(buf, &resp); err != nil {
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "error decoding response: %v", err)
}
return &LokiLabelNamesResponse{
Status: resp.Status,
Version: uint32(loghttp.GetVersion(req.Path)),
Version: uint32(loghttp.GetVersion(req.Path())),
Data: resp.Data,
Headers: httpResponseHeadersToPromResponseHeaders(r.Header),
}, nil
@ -669,7 +705,7 @@ func decodeResponseProtobuf(r *http.Response, req queryrangebase.Request) (query
switch req.(type) {
case *LokiSeriesRequest:
return resp.GetSeries().WithHeaders(headers), nil
case *LokiLabelNamesRequest:
case *LabelRequest:
return resp.GetLabels().WithHeaders(headers), nil
case *logproto.IndexStatsRequest:
return resp.GetStats().WithHeaders(headers), nil
@ -1137,9 +1173,9 @@ func paramsFromRequest(req queryrangebase.Request) (logql.Params, error) {
return &paramsSeriesWrapper{
LokiSeriesRequest: r,
}, nil
case *LokiLabelNamesRequest:
return &paramsLabelNamesWrapper{
LokiLabelNamesRequest: r,
case *LabelRequest:
return &paramsLabelWrapper{
LabelRequest: r,
}, nil
default:
return nil, fmt.Errorf("expected one of the *LokiRequest, *LokiInstantRequest, *LokiSeriesRequest, *LokiLabelNamesRequest, got (%T)", r)
@ -1232,31 +1268,31 @@ func (p paramsSeriesWrapper) Shards() []string {
return p.GetShards()
}
type paramsLabelNamesWrapper struct {
*LokiLabelNamesRequest
type paramsLabelWrapper struct {
*LabelRequest
}
func (p paramsLabelNamesWrapper) Query() string {
func (p paramsLabelWrapper) Query() string {
return p.GetQuery()
}
func (p paramsLabelNamesWrapper) Start() time.Time {
return p.LokiLabelNamesRequest.GetStartTs()
func (p paramsLabelWrapper) Start() time.Time {
return p.LabelRequest.GetStartTs()
}
func (p paramsLabelNamesWrapper) End() time.Time {
return p.LokiLabelNamesRequest.GetEndTs()
func (p paramsLabelWrapper) End() time.Time {
return p.LabelRequest.GetEndTs()
}
func (p paramsLabelNamesWrapper) Step() time.Duration {
func (p paramsLabelWrapper) Step() time.Duration {
return time.Duration(p.GetStep() * 1e6)
}
func (p paramsLabelNamesWrapper) Interval() time.Duration { return 0 }
func (p paramsLabelNamesWrapper) Direction() logproto.Direction {
func (p paramsLabelWrapper) Interval() time.Duration { return 0 }
func (p paramsLabelWrapper) Direction() logproto.Direction {
return logproto.FORWARD
}
func (p paramsLabelNamesWrapper) Limit() uint32 { return 0 }
func (p paramsLabelNamesWrapper) Shards() []string {
func (p paramsLabelWrapper) Limit() uint32 { return 0 }
func (p paramsLabelWrapper) Shards() []string {
return make([]string, 0)
}
@ -1281,10 +1317,10 @@ func NewEmptyResponse(r queryrangebase.Request) (queryrangebase.Response, error)
Status: loghttp.QueryStatusSuccess,
Version: uint32(loghttp.GetVersion(req.Path)),
}, nil
case *LokiLabelNamesRequest:
case *LabelRequest:
return &LokiLabelNamesResponse{
Status: loghttp.QueryStatusSuccess,
Version: uint32(loghttp.GetVersion(req.Path)),
Version: uint32(loghttp.GetVersion(req.Path())),
}, nil
case *LokiInstantRequest:
// instant queries in the frontend are always metrics queries.

@ -13,6 +13,7 @@ import (
"testing"
"time"
"github.com/gorilla/mux"
"github.com/prometheus/common/model"
"github.com/prometheus/prometheus/model/labels"
"github.com/prometheus/prometheus/promql"
@ -82,20 +83,15 @@ func Test_codec_EncodeDecodeRequest(t *testing.T) {
{"labels", func() (*http.Request, error) {
return http.NewRequest(http.MethodGet,
fmt.Sprintf(`/label?start=%d&end=%d`, start.UnixNano(), end.UnixNano()), nil)
}, &LokiLabelNamesRequest{
Path: "/label",
StartTs: start,
EndTs: end,
}, false},
}, NewLabelRequest(start, end, "", "", "/label"),
false},
{"label_values", func() (*http.Request, error) {
return http.NewRequest(http.MethodGet,
req, err := http.NewRequest(http.MethodGet,
fmt.Sprintf(`/label/test/values?start=%d&end=%d&query={foo="bar"}`, start.UnixNano(), end.UnixNano()), nil)
}, &LokiLabelNamesRequest{
Path: "/label/test/values",
StartTs: start,
EndTs: end,
Query: `{foo="bar"}`,
}, false},
req = mux.SetURLVars(req, map[string]string{"name": "test"})
return req, err
}, NewLabelRequest(start, end, `{foo="bar"}`, "test", "/label/test/values"),
false},
{"index_stats", func() (*http.Request, error) {
return DefaultCodec.EncodeRequest(context.Background(), &logproto.IndexStatsRequest{
From: model.TimeFromUnixNano(start.UnixNano()),
@ -180,6 +176,7 @@ func Test_codec_EncodeDecodeRequest(t *testing.T) {
if err != nil {
t.Fatal(err)
}
// TODO: context must save mux vars
got, err := DefaultCodec.DecodeRequest(context.TODO(), req, nil)
if (err != nil) != tt.wantErr {
t.Errorf("codec.DecodeRequest() error = %v, wantErr %v", err, tt.wantErr)
@ -287,7 +284,7 @@ func Test_codec_DecodeResponse(t *testing.T) {
},
{
"labels legacy", &http.Response{StatusCode: 200, Body: io.NopCloser(strings.NewReader(labelsString))},
&LokiLabelNamesRequest{Path: "/api/prom/label"},
NewLabelRequest(time.Now(), time.Now(), "", "", "/api/prom/label"),
&LokiLabelNamesResponse{
Status: "success",
Version: uint32(loghttp.VersionLegacy),
@ -626,11 +623,7 @@ func Test_codec_series_EncodeRequest(t *testing.T) {
func Test_codec_labels_EncodeRequest(t *testing.T) {
ctx := context.Background()
toEncode := &LokiLabelNamesRequest{
Path: "/loki/api/v1/labels",
StartTs: start,
EndTs: end,
}
toEncode := NewLabelRequest(start, end, "", "", "/loki/api/v1/labels")
got, err := DefaultCodec.EncodeRequest(ctx, toEncode)
require.NoError(t, err)
require.Equal(t, ctx, got.Context())
@ -641,51 +634,48 @@ func Test_codec_labels_EncodeRequest(t *testing.T) {
// testing a full roundtrip
req, err := DefaultCodec.DecodeRequest(context.TODO(), got, nil)
require.NoError(t, err)
require.Equal(t, toEncode.StartTs, req.(*LokiLabelNamesRequest).StartTs)
require.Equal(t, toEncode.EndTs, req.(*LokiLabelNamesRequest).EndTs)
require.Equal(t, "/loki/api/v1/labels", req.(*LokiLabelNamesRequest).Path)
require.Equal(t, toEncode.Start, req.(*LabelRequest).Start)
require.Equal(t, toEncode.End, req.(*LabelRequest).End)
require.Equal(t, "/loki/api/v1/labels", req.(*LabelRequest).Path())
// Test labels values endpoint
toEncode = &LokiLabelNamesRequest{
Path: "/loki/api/v1/labels/__name__/values",
StartTs: start,
EndTs: end,
Query: `{foo="bar"}`,
}
toEncode = NewLabelRequest(start, end, `{foo="bar"}`, "__name__", "/loki/api/v1/label/__name__/values")
got, err = DefaultCodec.EncodeRequest(ctx, toEncode)
require.NoError(t, err)
require.Equal(t, ctx, got.Context())
require.Equal(t, "/loki/api/v1/labels/__name__/values", got.URL.Path)
require.Equal(t, "/loki/api/v1/label/__name__/values", got.URL.Path)
require.Equal(t, fmt.Sprintf("%d", start.UnixNano()), got.URL.Query().Get("start"))
require.Equal(t, fmt.Sprintf("%d", end.UnixNano()), got.URL.Query().Get("end"))
require.Equal(t, `{foo="bar"}`, got.URL.Query().Get("query"))
// testing a full roundtrip
got = mux.SetURLVars(got, map[string]string{"name": "__name__"})
req, err = DefaultCodec.DecodeRequest(context.TODO(), got, nil)
require.NoError(t, err)
require.Equal(t, toEncode.StartTs, req.(*LokiLabelNamesRequest).StartTs)
require.Equal(t, toEncode.EndTs, req.(*LokiLabelNamesRequest).EndTs)
require.Equal(t, toEncode.Query, req.(*LokiLabelNamesRequest).Query)
require.Equal(t, "/loki/api/v1/labels/__name__/values", req.(*LokiLabelNamesRequest).Path)
require.Equal(t, toEncode.Start, req.(*LabelRequest).Start)
require.Equal(t, toEncode.End, req.(*LabelRequest).End)
require.Equal(t, toEncode.Query, req.(*LabelRequest).Query)
require.Equal(t, "/loki/api/v1/label/__name__/values", req.(*LabelRequest).Path())
}
func Test_codec_labels_DecodeRequest(t *testing.T) {
ctx := context.Background()
u, err := url.Parse(`/loki/api/v1/labels/__name__/values?start=1575285010000000010&end=1575288610000000010&query={foo="bar"}`)
u, err := url.Parse(`/loki/api/v1/label/__name__/values?start=1575285010000000010&end=1575288610000000010&query={foo="bar"}`)
require.NoError(t, err)
r := &http.Request{URL: u}
r = mux.SetURLVars(r, map[string]string{"name": "__name__"})
req, err := DefaultCodec.DecodeRequest(context.TODO(), r, nil)
require.NoError(t, err)
require.Equal(t, start, req.(*LokiLabelNamesRequest).StartTs)
require.Equal(t, end, req.(*LokiLabelNamesRequest).EndTs)
require.Equal(t, `{foo="bar"}`, req.(*LokiLabelNamesRequest).Query)
require.Equal(t, "/loki/api/v1/labels/__name__/values", req.(*LokiLabelNamesRequest).Path)
require.Equal(t, start, *req.(*LabelRequest).Start)
require.Equal(t, end, *req.(*LabelRequest).End)
require.Equal(t, `{foo="bar"}`, req.(*LabelRequest).Query)
require.Equal(t, "/loki/api/v1/label/__name__/values", req.(*LabelRequest).Path())
got, err := DefaultCodec.EncodeRequest(ctx, req)
require.NoError(t, err)
require.Equal(t, ctx, got.Context())
require.Equal(t, "/loki/api/v1/labels/__name__/values", got.URL.Path)
require.Equal(t, "/loki/api/v1/label/__name__/values", got.URL.Path)
require.Equal(t, fmt.Sprintf("%d", start.UnixNano()), got.URL.Query().Get("start"))
require.Equal(t, fmt.Sprintf("%d", end.UnixNano()), got.URL.Query().Get("end"))
require.Equal(t, `{foo="bar"}`, got.URL.Query().Get("query"))

@ -470,73 +470,6 @@ func (m *LokiSeriesResponse) GetStatistics() stats.Result {
return stats.Result{}
}
type LokiLabelNamesRequest struct {
StartTs time.Time `protobuf:"bytes,1,opt,name=startTs,proto3,stdtime" json:"startTs"`
EndTs time.Time `protobuf:"bytes,2,opt,name=endTs,proto3,stdtime" json:"endTs"`
Path string `protobuf:"bytes,3,opt,name=path,proto3" json:"path,omitempty"`
Query string `protobuf:"bytes,4,opt,name=query,proto3" json:"query,omitempty"`
}
func (m *LokiLabelNamesRequest) Reset() { *m = LokiLabelNamesRequest{} }
func (*LokiLabelNamesRequest) ProtoMessage() {}
func (*LokiLabelNamesRequest) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{5}
}
func (m *LokiLabelNamesRequest) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
}
func (m *LokiLabelNamesRequest) XXX_Marshal(b []byte, deterministic bool) ([]byte, error) {
if deterministic {
return xxx_messageInfo_LokiLabelNamesRequest.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 *LokiLabelNamesRequest) XXX_Merge(src proto.Message) {
xxx_messageInfo_LokiLabelNamesRequest.Merge(m, src)
}
func (m *LokiLabelNamesRequest) XXX_Size() int {
return m.Size()
}
func (m *LokiLabelNamesRequest) XXX_DiscardUnknown() {
xxx_messageInfo_LokiLabelNamesRequest.DiscardUnknown(m)
}
var xxx_messageInfo_LokiLabelNamesRequest proto.InternalMessageInfo
func (m *LokiLabelNamesRequest) GetStartTs() time.Time {
if m != nil {
return m.StartTs
}
return time.Time{}
}
func (m *LokiLabelNamesRequest) GetEndTs() time.Time {
if m != nil {
return m.EndTs
}
return time.Time{}
}
func (m *LokiLabelNamesRequest) GetPath() string {
if m != nil {
return m.Path
}
return ""
}
func (m *LokiLabelNamesRequest) GetQuery() string {
if m != nil {
return m.Query
}
return ""
}
type LokiLabelNamesResponse struct {
Status string `protobuf:"bytes,1,opt,name=Status,proto3" json:"status"`
Data []string `protobuf:"bytes,2,rep,name=Data,proto3" json:"data,omitempty"`
@ -548,7 +481,7 @@ type LokiLabelNamesResponse struct {
func (m *LokiLabelNamesResponse) Reset() { *m = LokiLabelNamesResponse{} }
func (*LokiLabelNamesResponse) ProtoMessage() {}
func (*LokiLabelNamesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{6}
return fileDescriptor_51b9d53b40d11902, []int{5}
}
func (m *LokiLabelNamesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -613,7 +546,7 @@ type LokiData struct {
func (m *LokiData) Reset() { *m = LokiData{} }
func (*LokiData) ProtoMessage() {}
func (*LokiData) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{7}
return fileDescriptor_51b9d53b40d11902, []int{6}
}
func (m *LokiData) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -658,7 +591,7 @@ type LokiPromResponse struct {
func (m *LokiPromResponse) Reset() { *m = LokiPromResponse{} }
func (*LokiPromResponse) ProtoMessage() {}
func (*LokiPromResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{8}
return fileDescriptor_51b9d53b40d11902, []int{7}
}
func (m *LokiPromResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -709,7 +642,7 @@ type IndexStatsResponse struct {
func (m *IndexStatsResponse) Reset() { *m = IndexStatsResponse{} }
func (*IndexStatsResponse) ProtoMessage() {}
func (*IndexStatsResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{9}
return fileDescriptor_51b9d53b40d11902, []int{8}
}
func (m *IndexStatsResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -746,7 +679,7 @@ type VolumeResponse struct {
func (m *VolumeResponse) Reset() { *m = VolumeResponse{} }
func (*VolumeResponse) ProtoMessage() {}
func (*VolumeResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{10}
return fileDescriptor_51b9d53b40d11902, []int{9}
}
func (m *VolumeResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -783,7 +716,7 @@ type TopKSketchesResponse struct {
func (m *TopKSketchesResponse) Reset() { *m = TopKSketchesResponse{} }
func (*TopKSketchesResponse) ProtoMessage() {}
func (*TopKSketchesResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{11}
return fileDescriptor_51b9d53b40d11902, []int{10}
}
func (m *TopKSketchesResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -820,7 +753,7 @@ type QuantileSketchResponse struct {
func (m *QuantileSketchResponse) Reset() { *m = QuantileSketchResponse{} }
func (*QuantileSketchResponse) ProtoMessage() {}
func (*QuantileSketchResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{12}
return fileDescriptor_51b9d53b40d11902, []int{11}
}
func (m *QuantileSketchResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -865,7 +798,7 @@ type QueryResponse struct {
func (m *QueryResponse) Reset() { *m = QueryResponse{} }
func (*QueryResponse) ProtoMessage() {}
func (*QueryResponse) Descriptor() ([]byte, []int) {
return fileDescriptor_51b9d53b40d11902, []int{13}
return fileDescriptor_51b9d53b40d11902, []int{12}
}
func (m *QueryResponse) XXX_Unmarshal(b []byte) error {
return m.Unmarshal(b)
@ -1018,7 +951,6 @@ func init() {
proto.RegisterType((*LokiResponse)(nil), "queryrange.LokiResponse")
proto.RegisterType((*LokiSeriesRequest)(nil), "queryrange.LokiSeriesRequest")
proto.RegisterType((*LokiSeriesResponse)(nil), "queryrange.LokiSeriesResponse")
proto.RegisterType((*LokiLabelNamesRequest)(nil), "queryrange.LokiLabelNamesRequest")
proto.RegisterType((*LokiLabelNamesResponse)(nil), "queryrange.LokiLabelNamesResponse")
proto.RegisterType((*LokiData)(nil), "queryrange.LokiData")
proto.RegisterType((*LokiPromResponse)(nil), "queryrange.LokiPromResponse")
@ -1034,88 +966,86 @@ func init() {
}
var fileDescriptor_51b9d53b40d11902 = []byte{
// 1283 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x57, 0x4d, 0x6f, 0x1b, 0x45,
0x18, 0xde, 0xf1, 0x57, 0xe2, 0x49, 0x1b, 0xca, 0x24, 0xb4, 0x4b, 0xa8, 0x76, 0x2d, 0x4b, 0x50,
0x23, 0x81, 0x2d, 0x92, 0xd2, 0x52, 0xbe, 0x44, 0x97, 0x52, 0xa5, 0xa2, 0xa0, 0x76, 0x1b, 0x71,
0x1f, 0xc7, 0x13, 0x7b, 0xf1, 0x7e, 0x65, 0x67, 0x5c, 0x35, 0x37, 0x2e, 0xdc, 0x40, 0xea, 0xaf,
0x40, 0x48, 0x54, 0xfc, 0x00, 0x24, 0x2e, 0x9c, 0x7a, 0xcc, 0xb1, 0xb2, 0xc4, 0x42, 0xdd, 0x0b,
0xe4, 0xd4, 0x9f, 0x80, 0x66, 0x66, 0x77, 0x3d, 0x6b, 0xbb, 0xad, 0xdd, 0x5e, 0x1a, 0x89, 0x8b,
0x3d, 0x1f, 0xef, 0x33, 0x3b, 0xef, 0x33, 0xcf, 0xfb, 0xbe, 0x33, 0xf0, 0x5c, 0xd8, 0xef, 0xb6,
0xf6, 0x07, 0x24, 0x72, 0x48, 0x24, 0xfe, 0x0f, 0x22, 0xec, 0x77, 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, 0x1e, 0x3f, 0x34, 0xc0, 0x77, 0x23, 0x03,
0xfc, 0x3c, 0x32, 0xc0, 0xfd, 0x91, 0x01, 0x0e, 0x47, 0x06, 0xf8, 0x7b, 0x64, 0x80, 0x7f, 0x46,
0x86, 0xf6, 0x78, 0x64, 0x80, 0xbb, 0x8f, 0x0c, 0xed, 0xf0, 0x91, 0xa1, 0x3d, 0x78, 0x64, 0x68,
0xed, 0x8a, 0x08, 0x89, 0xad, 0xff, 0x02, 0x00, 0x00, 0xff, 0xff, 0x19, 0xf8, 0x4d, 0xef, 0xc8,
0x12, 0x00, 0x00,
// 1257 bytes of a gzipped FileDescriptorProto
0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xec, 0x97, 0xcd, 0x6f, 0x1b, 0xc5,
0x1b, 0xc7, 0x77, 0xfd, 0x96, 0x78, 0xdc, 0xe6, 0xd7, 0xdf, 0x24, 0x6a, 0x97, 0x50, 0xed, 0x5a,
0x96, 0xa0, 0x46, 0x02, 0x5b, 0x38, 0xa5, 0xa5, 0xbc, 0x89, 0x2e, 0xa1, 0x72, 0x44, 0x41, 0xed,
0xc6, 0xe2, 0x3e, 0x8e, 0x27, 0xf6, 0xe2, 0x7d, 0xcb, 0xce, 0x38, 0x6a, 0x6e, 0x5c, 0xb8, 0x81,
0xd4, 0xbf, 0x02, 0x21, 0x51, 0xf1, 0x07, 0x70, 0xe4, 0x94, 0x63, 0x8e, 0x95, 0x25, 0x16, 0xe2,
0x5c, 0x20, 0xa7, 0xfc, 0x09, 0x68, 0x66, 0x76, 0xd7, 0xbb, 0xb6, 0x93, 0xda, 0xe5, 0xd2, 0x48,
0x5c, 0xec, 0x79, 0x79, 0xbe, 0xb3, 0xfb, 0x7c, 0xe6, 0x79, 0x9e, 0x9d, 0x01, 0xb7, 0xbc, 0x7e,
0xb7, 0xbe, 0x37, 0xc0, 0xbe, 0x89, 0x7d, 0xfe, 0x7f, 0xe0, 0x23, 0xa7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0xca, 0x4f, 0x4f, 0x54, 0xe9, 0xe8,
0x44, 0x95, 0x9e, 0x9f, 0xa8, 0x52, 0xbb, 0xc0, 0x53, 0x62, 0xe3, 0x9f, 0x00, 0x00, 0x00, 0xff,
0xff, 0x57, 0xdc, 0x66, 0x15, 0x08, 0x12, 0x00, 0x00,
}
func (this *LokiRequest) Equal(that interface{}) bool {
@ -1360,39 +1290,6 @@ func (this *LokiSeriesResponse) Equal(that interface{}) bool {
}
return true
}
func (this *LokiLabelNamesRequest) Equal(that interface{}) bool {
if that == nil {
return this == nil
}
that1, ok := that.(*LokiLabelNamesRequest)
if !ok {
that2, ok := that.(LokiLabelNamesRequest)
if ok {
that1 = &that2
} else {
return false
}
}
if that1 == nil {
return this == nil
} else if this == nil {
return false
}
if !this.StartTs.Equal(that1.StartTs) {
return false
}
if !this.EndTs.Equal(that1.EndTs) {
return false
}
if this.Path != that1.Path {
return false
}
if this.Query != that1.Query {
return false
}
return true
}
func (this *LokiLabelNamesResponse) Equal(that interface{}) bool {
if that == nil {
return this == nil
@ -1949,19 +1846,6 @@ func (this *LokiSeriesResponse) GoString() string {
s = append(s, "}")
return strings.Join(s, "")
}
func (this *LokiLabelNamesRequest) GoString() string {
if this == nil {
return "nil"
}
s := make([]string, 0, 8)
s = append(s, "&queryrange.LokiLabelNamesRequest{")
s = append(s, "StartTs: "+fmt.Sprintf("%#v", this.StartTs)+",\n")
s = append(s, "EndTs: "+fmt.Sprintf("%#v", this.EndTs)+",\n")
s = append(s, "Path: "+fmt.Sprintf("%#v", this.Path)+",\n")
s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n")
s = append(s, "}")
return strings.Join(s, "")
}
func (this *LokiLabelNamesResponse) GoString() string {
if this == nil {
return "nil"
@ -2504,59 +2388,6 @@ func (m *LokiSeriesResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
return len(dAtA) - i, nil
}
func (m *LokiLabelNamesRequest) 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 *LokiLabelNamesRequest) MarshalTo(dAtA []byte) (int, error) {
size := m.Size()
return m.MarshalToSizedBuffer(dAtA[:size])
}
func (m *LokiLabelNamesRequest) MarshalToSizedBuffer(dAtA []byte) (int, error) {
i := len(dAtA)
_ = i
var l int
_ = l
if len(m.Query) > 0 {
i -= len(m.Query)
copy(dAtA[i:], m.Query)
i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Query)))
i--
dAtA[i] = 0x22
}
if len(m.Path) > 0 {
i -= len(m.Path)
copy(dAtA[i:], m.Path)
i = encodeVarintQueryrange(dAtA, i, uint64(len(m.Path)))
i--
dAtA[i] = 0x1a
}
n9, err9 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.EndTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs):])
if err9 != nil {
return 0, err9
}
i -= n9
i = encodeVarintQueryrange(dAtA, i, uint64(n9))
i--
dAtA[i] = 0x12
n10, err10 := github_com_gogo_protobuf_types.StdTimeMarshalTo(m.StartTs, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs):])
if err10 != nil {
return 0, err10
}
i -= n10
i = encodeVarintQueryrange(dAtA, i, uint64(n10))
i--
dAtA[i] = 0xa
return len(dAtA) - i, nil
}
func (m *LokiLabelNamesResponse) Marshal() (dAtA []byte, err error) {
size := m.Size()
dAtA = make([]byte, size)
@ -3282,27 +3113,6 @@ func (m *LokiSeriesResponse) Size() (n int) {
return n
}
func (m *LokiLabelNamesRequest) Size() (n int) {
if m == nil {
return 0
}
var l int
_ = l
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.StartTs)
n += 1 + l + sovQueryrange(uint64(l))
l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EndTs)
n += 1 + l + sovQueryrange(uint64(l))
l = len(m.Path)
if l > 0 {
n += 1 + l + sovQueryrange(uint64(l))
}
l = len(m.Query)
if l > 0 {
n += 1 + l + sovQueryrange(uint64(l))
}
return n
}
func (m *LokiLabelNamesResponse) Size() (n int) {
if m == nil {
return 0
@ -3642,19 +3452,6 @@ func (this *LokiSeriesResponse) String() string {
}, "")
return s
}
func (this *LokiLabelNamesRequest) String() string {
if this == nil {
return "nil"
}
s := strings.Join([]string{`&LokiLabelNamesRequest{`,
`StartTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.StartTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`EndTs:` + strings.Replace(strings.Replace(fmt.Sprintf("%v", this.EndTs), "Timestamp", "types.Timestamp", 1), `&`, ``, 1) + `,`,
`Path:` + fmt.Sprintf("%v", this.Path) + `,`,
`Query:` + fmt.Sprintf("%v", this.Query) + `,`,
`}`,
}, "")
return s
}
func (this *LokiLabelNamesResponse) String() string {
if this == nil {
return "nil"
@ -5070,189 +4867,6 @@ func (m *LokiSeriesResponse) Unmarshal(dAtA []byte) error {
}
return nil
}
func (m *LokiLabelNamesRequest) 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: LokiLabelNamesRequest: wiretype end group for non-group")
}
if fieldNum <= 0 {
return fmt.Errorf("proto: LokiLabelNamesRequest: illegal tag %d (wire type %d)", fieldNum, wire)
}
switch fieldNum {
case 1:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field StartTs", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.StartTs, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 2:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field EndTs", 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 err := github_com_gogo_protobuf_types.StdTimeUnmarshal(&m.EndTs, dAtA[iNdEx:postIndex]); err != nil {
return err
}
iNdEx = postIndex
case 3:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Path", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQueryrange
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQueryrange
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQueryrange
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Path = string(dAtA[iNdEx:postIndex])
iNdEx = postIndex
case 4:
if wireType != 2 {
return fmt.Errorf("proto: wrong wireType = %d for field Query", wireType)
}
var stringLen uint64
for shift := uint(0); ; shift += 7 {
if shift >= 64 {
return ErrIntOverflowQueryrange
}
if iNdEx >= l {
return io.ErrUnexpectedEOF
}
b := dAtA[iNdEx]
iNdEx++
stringLen |= uint64(b&0x7F) << shift
if b < 0x80 {
break
}
}
intStringLen := int(stringLen)
if intStringLen < 0 {
return ErrInvalidLengthQueryrange
}
postIndex := iNdEx + intStringLen
if postIndex < 0 {
return ErrInvalidLengthQueryrange
}
if postIndex > l {
return io.ErrUnexpectedEOF
}
m.Query = string(dAtA[iNdEx:postIndex])
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 (m *LokiLabelNamesResponse) Unmarshal(dAtA []byte) error {
l := len(dAtA)
iNdEx := 0

@ -96,19 +96,6 @@ message LokiSeriesResponse {
];
}
message LokiLabelNamesRequest {
google.protobuf.Timestamp startTs = 1 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
google.protobuf.Timestamp endTs = 2 [
(gogoproto.stdtime) = true,
(gogoproto.nullable) = false
];
string path = 3;
string query = 4;
}
message LokiLabelNamesResponse {
string Status = 1 [(gogoproto.jsontag) = "status"];
repeated string Data = 2 [(gogoproto.jsontag) = "data,omitempty"];

@ -468,11 +468,13 @@ func TestLabelsTripperware(t *testing.T) {
require.NoError(t, err)
defer rt.Close()
lreq := &LokiLabelNamesRequest{
StartTs: testTime.Add(-25 * time.Hour), // bigger than the limit
EndTs: testTime,
Path: "/loki/api/v1/labels",
}
lreq := NewLabelRequest(
testTime.Add(-25*time.Hour), // bigger than the limit
testTime,
"",
"",
"/loki/api/v1/labels",
)
ctx := user.InjectOrgID(context.Background(), "1")
req, err := DefaultCodec.EncodeRequest(ctx, lreq)

@ -213,7 +213,7 @@ func (h *splitByInterval) Do(ctx context.Context, r queryrangebase.Request) (que
intervals[i], intervals[j] = intervals[j], intervals[i]
}
}
case *LokiSeriesRequest, *LokiLabelNamesRequest, *logproto.IndexStatsRequest, *logproto.VolumeRequest:
case *LokiSeriesRequest, *LabelRequest, *logproto.IndexStatsRequest, *logproto.VolumeRequest:
// Set this to 0 since this is not used in Series/Labels/Index Request.
limit = 0
default:
@ -268,17 +268,12 @@ func splitByTime(req queryrangebase.Request, interval time.Duration) ([]queryran
Shards: r.Shards,
})
})
case *LokiLabelNamesRequest:
case *LabelRequest:
// metadata queries have end time inclusive.
// Set endTimeInclusive to true so that ForInterval keeps a gap of 1ms between splits to
// avoid querying duplicate data in adjacent queries.
util.ForInterval(interval, r.StartTs, r.EndTs, true, func(start, end time.Time) {
reqs = append(reqs, &LokiLabelNamesRequest{
Path: r.Path,
StartTs: start,
EndTs: end,
Query: r.Query,
})
util.ForInterval(interval, *r.Start, *r.End, true, func(start, end time.Time) {
reqs = append(reqs, NewLabelRequest(start, end, r.Query, r.Name, r.Path()))
})
case *logproto.IndexStatsRequest:
startTS := model.Time(r.GetStart()).Time()

@ -90,11 +90,7 @@ func Test_splitQuery(t *testing.T) {
}
buildLokiLabelNamesRequest := func(start, end time.Time) queryrangebase.Request {
return &LokiLabelNamesRequest{
StartTs: start,
EndTs: end,
Path: "/labels",
}
return NewLabelRequest(start, end, "", "", "/lables")
}
type interval struct {

@ -7,7 +7,6 @@ import (
"net"
"net/http"
"strconv"
"strings"
"time"
"github.com/grafana/loki/pkg/logproto"
@ -182,8 +181,8 @@ func StatsCollectorMiddleware() queryrangebase.Middleware {
// Record information for metadata queries.
switch r := req.(type) {
case *LokiLabelNamesRequest:
data.label = getLabelNameFromLabelsQuery(r.Path)
case *LabelRequest:
data.label = r.Name
case *LokiSeriesRequest:
data.match = r.Match
}
@ -193,25 +192,6 @@ func StatsCollectorMiddleware() queryrangebase.Middleware {
})
}
func getLabelNameFromLabelsQuery(path string) string {
if strings.HasSuffix(path, "/values") {
toks := strings.FieldsFunc(path, func(r rune) bool {
return r == '/'
})
// now assuming path has suffix `/values` label name should be second last to the suffix
// **if** there exists the second last.
length := len(toks)
if length >= 2 {
return toks[length-2]
}
}
return ""
}
// interceptor implements WriteHeader to intercept status codes. WriteHeader
// may not be called on success, so initialize statusCode with the status you
// want to report on success, i.e. http.StatusOK.

Loading…
Cancel
Save