diff --git a/pkg/loghttp/labels.go b/pkg/loghttp/labels.go index 8c154c3839fa0..efa059fc9709c 100644 --- a/pkg/loghttp/labels.go +++ b/pkg/loghttp/labels.go @@ -87,3 +87,29 @@ func ParseLabelQuery(r *http.Request) (*logproto.LabelRequest, error) { return req, nil } +func ParseDetectedLabelsQuery(r *http.Request) (*logproto.DetectedLabelsRequest, error) { + start, end, err := bounds(r) + if err != nil { + return nil, err + } + + return &logproto.DetectedLabelsRequest{ + Start: &start, + End: &end, + Query: query(r), + }, nil +} + +func ParseDetectedFieldsQuery(r *http.Request) (*logproto.DetectedFieldsRequest, error) { + req := &logproto.DetectedFieldsRequest{} + + start, end, err := bounds(r) + if err != nil { + return nil, err + } + req.Start = &start + req.End = &end + + req.Query = query(r) + return req, nil +} diff --git a/pkg/logproto/logproto.pb.go b/pkg/logproto/logproto.pb.go index f8b38f5230774..542f350fae134 100644 --- a/pkg/logproto/logproto.pb.go +++ b/pkg/logproto/logproto.pb.go @@ -3057,6 +3057,160 @@ var fileDescriptor_c28a5f14f1f4c79a = []byte{ 0x7a, 0xfc, 0xb4, 0x9e, 0xfa, 0xfc, 0x69, 0x3d, 0x75, 0xf7, 0x95, 0xaf, 0xa8, 0xbe, 0xa4, 0xab, 0xc9, 0x89, 0xbf, 0x73, 0xff, 0x0d, 0x00, 0x00, 0xff, 0xff, 0xa8, 0x14, 0xf9, 0x0c, 0xe8, 0x1f, 0x00, 0x00, +======= + // 2431 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xd4, 0x19, 0x4b, 0x6f, 0x1b, 0xc7, + 0x99, 0x4b, 0x2e, 0x5f, 0x1f, 0x29, 0x59, 0x1e, 0xd1, 0x32, 0xc1, 0xd8, 0xa4, 0x3c, 0x48, 0x1c, + 0xd5, 0x71, 0xc4, 0x58, 0x6e, 0xdc, 0xd4, 0x6e, 0x90, 0x9a, 0x52, 0xec, 0xc8, 0x96,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 0x06, 0xff, 0xde, 0x80, + 0xb2, 0x94, 0x5c, 0xb9, 0xdd, 0x0f, 0x21, 0x27, 0x15, 0x23, 0x64, 0x7f, 0x4e, 0x70, 0x79, 0x63, + 0x92, 0xc0, 0xa2, 0x68, 0xa2, 0xf7, 0x60, 0xba, 0xe3, 0xb9, 0x83, 0x01, 0xed, 0xac, 0xab, 0x10, + 0x96, 0x4e, 0x86, 0xb0, 0x95, 0xe8, 0x3a, 0x49, 0xa0, 0xe3, 0xbf, 0x18, 0x30, 0xa5, 0xa2, 0x85, + 0xb2, 0x55, 0xa0, 0x5f, 0xe3, 0xd0, 0x29, 0x2b, 0x3d, 0x69, 0xca, 0x9a, 0x83, 0x5c, 0xd7, 0x73, + 0x87, 0x03, 0xbf, 0x9a, 0x91, 0x77, 0x53, 0xce, 0x26, 0x4b, 0x65, 0xf8, 0x1a, 0x4c, 0x6b, 0x51, + 0x0e, 0x08, 0x99, 0xb5, 0x64, 0xc8, 0x5c, 0xed, 0x50, 0x87, 0xd9, 0x9b, 0x76, 0x10, 0x04, 0x15, + 0x3e, 0xfe, 0x99, 0x01, 0x33, 0x49, 0x14, 0xb4, 0x12, 0xb9, 0x67, 0x9c, 0xdc, 0xe9, 0x83, 0xc9, + 0x2d, 0x8a, 0xe0, 0xe3, 0xbf, 0xef, 0x30, 0x6f, 0x47, 0x93, 0x96, 0x7b, 0x6b, 0x6f, 0x43, 0x29, + 0xb2, 0xc8, 0x53, 0xd4, 0x36, 0x55, 0x37, 0x83, 0xf0, 0x61, 0x18, 0x12, 0xd2, 0x32, 0xa0, 0x89, + 0x09, 0xfe, 0xb9, 0x01, 0x53, 0x31, 0x5b, 0xa2, 0x77, 0xc0, 0xdc, 0xf4, 0xdc, 0xfe, 0x44, 0x86, + 0x12, 0x3b, 0xd0, 0x37, 0x21, 0xcd, 0xdc, 0x89, 0xcc, 0x94, 0x66, 0x2e, 0xb7, 0x92, 0x12, 0x3f, + 0x23, 0xab, 0x5b, 0x39, 0xc3,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, 0x6e, 0xd0, 0x38, 0x95, 0x49, 0x04, 0x72, + 0x40, 0xc9, 0xb0, 0x0c, 0x47, 0xa3, 0x1c, 0x49, 0x73, 0x2f, 0x42, 0xfe, 0xc3, 0x61, 0x54, 0x5d, + 0x95, 0x84, 0xba, 0x64, 0x0f, 0xae, 0x91, 0xb8, 0xcf, 0x40, 0x08, 0x47, 0x27, 0xa0, 0xc8, 0xac, + 0x8d, 0x1e, 0xbd, 0x19, 0x06, 0xb8, 0x10, 0xc0, 0x57, 0x79, 0xcf, 0x77, 0x37, 0x52, 0xfb, 0x84, + 0x00, 0x74, 0x06, 0x66, 0x42, 0x9e, 0x6f, 0x7b, 0x74, 0xd3, 0x7e, 0x24, 0x2c, 0x5c, 0x26, 0xfb, + 0xe0, 0x68, 0x01, 0x8e, 0x84, 0xb0, 0x75, 0x51, 0x63, 0x98, 0x02, 0x35, 0x09, 0xe6, 0xba, 0x11, + 0xe2, 0xbe, 0xff, 0x60, 0x68, 0xf5, 0xc4, 0xcd, 0x2b, 0x93, 0x08, 0x04, 0xff, 0xc9, 0x80, 0xa3, + 0xd2, 0xd4, 0xbc, 0xdb, 0x7f, 0x19, 0xbd, 0xfe, 0x33, 0x03, 0x50, 0x54, 0x02, 0xe5, 0x5a, 0xaf, + 0x45, 0x9f, 0x71, 0x78, 0x11, 0x53, 0x12, 0xad, 0xac, 0x04, 0x85, 0x2f, 0x31, 0x18, 0x72, 0xa2, + 0x10, 0x92, 0x3d, 0xb5, 0x29, 0x7b, 0x65, 0x09, 0x21, 0xea, 0xcb, 0x5b, 0xfc, 0x8d, 0x1d, 0x46, + 0x7d, 0xd5, 0xe9, 0x8a, 0x16, 0x5f, 0x00, 0x88, 0xfc, 0xf0, 0xb3, 0xa8, 0xc3, 0x84, 0xd7, 0x98, + 0xe1, 0x59, 0x0a, 0x44, 0xf4, 0x00, 0xff, 0x2e, 0x0d, 0x53, 0x77, 0xdd, 0xde, 0x30, 0x4c, 0x89, + 0x2f, 0x53, 0x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0x00, 0x00, 0xff, 0xff, 0xa2, 0x75, 0x76, 0x03, 0x96, 0x1f, 0x00, 0x00, } func (x Direction) String() string { @@ -5383,6 +5537,41 @@ func (this *DetectedLabel) GoString() string { s = append(s, "}") return strings.Join(s, "") } +func valueToGoStringLogproto(v interface{}, typ string) string { + rv := reflect.ValueOf(v) + if rv.IsNil() { + return "nil" + } + s := make([]string, 0, 7) + s = append(s, "&logproto.DetectedLabelsRequest{") + s = append(s, "Start: "+fmt.Sprintf("%#v", this.Start)+",\n") + s = append(s, "End: "+fmt.Sprintf("%#v", this.End)+",\n") + s = append(s, "Query: "+fmt.Sprintf("%#v", this.Query)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DetectedLabelsResponse) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&logproto.DetectedLabelsResponse{") + if this.DetectedLabels != nil { + s = append(s, "DetectedLabels: "+fmt.Sprintf("%#v", this.DetectedLabels)+",\n") + } + s = append(s, "}") + return strings.Join(s, "") +} +func (this *DetectedLabel) GoString() string { + if this == nil { + return "nil" + } + s := make([]string, 0, 5) + s = append(s, "&logproto.DetectedLabel{") + s = append(s, "Label: "+fmt.Sprintf("%#v", this.Label)+",\n") + s = append(s, "}") + return strings.Join(s, "") +} func valueToGoStringLogproto(v interface{}, typ string) string { rv := reflect.ValueOf(v) if rv.IsNil() { @@ -8229,6 +8418,123 @@ func (m *DetectedLabel) MarshalToSizedBuffer(dAtA []byte) (int, error) { return len(dAtA) - i, nil } +func (m *DetectedLabelsRequest) 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 *DetectedLabelsRequest) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetectedLabelsRequest) 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 = encodeVarintLogproto(dAtA, i, uint64(len(m.Query))) + i-- + dAtA[i] = 0x1a + } + if m.End != nil { + n23, err23 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.End, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.End):]) + if err23 != nil { + return 0, err23 + } + i -= n23 + i = encodeVarintLogproto(dAtA, i, uint64(n23)) + i-- + dAtA[i] = 0x12 + } + if m.Start != nil { + n24, err24 := github_com_gogo_protobuf_types.StdTimeMarshalTo(*m.Start, dAtA[i-github_com_gogo_protobuf_types.SizeOfStdTime(*m.Start):]) + if err24 != nil { + return 0, err24 + } + i -= n24 + i = encodeVarintLogproto(dAtA, i, uint64(n24)) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + +func (m *DetectedLabelsResponse) 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 *DetectedLabelsResponse) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetectedLabelsResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.DetectedLabels) > 0 { + for iNdEx := len(m.DetectedLabels) - 1; iNdEx >= 0; iNdEx-- { + { + size, err := m.DetectedLabels[iNdEx].MarshalToSizedBuffer(dAtA[:i]) + if err != nil { + return 0, err + } + i -= size + i = encodeVarintLogproto(dAtA, i, uint64(size)) + } + i-- + dAtA[i] = 0xa + } + } + return len(dAtA) - i, nil +} + +func (m *DetectedLabel) 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 *DetectedLabel) MarshalTo(dAtA []byte) (int, error) { + size := m.Size() + return m.MarshalToSizedBuffer(dAtA[:size]) +} + +func (m *DetectedLabel) MarshalToSizedBuffer(dAtA []byte) (int, error) { + i := len(dAtA) + _ = i + var l int + _ = l + if len(m.Label) > 0 { + i -= len(m.Label) + copy(dAtA[i:], m.Label) + i = encodeVarintLogproto(dAtA, i, uint64(len(m.Label))) + i-- + dAtA[i] = 0xa + } + return len(dAtA) - i, nil +} + func encodeVarintLogproto(dAtA []byte, offset int, v uint64) int { offset -= sovLogproto(v) base := offset diff --git a/pkg/querier/querier.go b/pkg/querier/querier.go index 59578f866ff69..1fc54da8d6d4c 100644 --- a/pkg/querier/querier.go +++ b/pkg/querier/querier.go @@ -1157,3 +1157,13 @@ func streamsForFieldDetection(i iter.EntryIterator, size uint32, interval time.D sort.Sort(result) return result, i.Error() } + +func (q *SingleTenantQuerier) DetectedLabels(_ context.Context, _ *logproto.DetectedLabelsRequest) (*logproto.DetectedLabelsResponse, error) { + return &logproto.DetectedLabelsResponse{ + DetectedLabels: []*logproto.DetectedLabel{ + {Label: "namespace"}, + {Label: "cluster"}, + {Label: "instance"}, + }, + }, nil +} \ No newline at end of file diff --git a/pkg/querier/queryrange/codec.go b/pkg/querier/queryrange/codec.go index 6d9feaa77e1de..f0b38f846ec11 100644 --- a/pkg/querier/queryrange/codec.go +++ b/pkg/querier/queryrange/codec.go @@ -976,6 +976,26 @@ func (c Codec) EncodeRequest(ctx context.Context, r queryrangebase.Request) (*ht Header: header, } + return req.WithContext(ctx), nil + case *DetectedLabelsRequest: + params := url.Values{ + "start": []string{fmt.Sprintf("%d", request.Start.UnixNano())}, + "end": []string{fmt.Sprintf("%d", request.End.UnixNano())}, + "query": []string{request.GetQuery()}, + } + + u := &url.URL{ + Path: "/loki/api/v1/detected_labels", + 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, fmt.Sprintf("invalid request format, got (%T)", r))