Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Fixes detected labels API wiring #12442

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion pkg/querier/queryrange/codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -1075,7 +1075,6 @@ func decodeResponseJSON(r *http.Response, req queryrangebase.Request) (queryrang
}

func decodeResponseJSONFrom(buf []byte, req queryrangebase.Request, headers http.Header) (queryrangebase.Response, error) {

switch req := req.(type) {
case *LokiSeriesRequest:
var resp LokiSeriesResponse
Expand Down Expand Up @@ -1136,6 +1135,15 @@ func decodeResponseJSONFrom(buf []byte, req queryrangebase.Request, headers http
Response: &resp,
Headers: httpResponseHeadersToPromResponseHeaders(headers),
}, nil
case *DetectedLabelsRequest:
var resp logproto.DetectedLabelsResponse
if err := json.Unmarshal(buf, &resp); err != nil {
return nil, httpgrpc.Errorf(http.StatusInternalServerError, "error decoding response: %v", err)
}
return &DetectedLabelsResponse{
Response: &resp,
Headers: httpResponseHeadersToPromResponseHeaders(headers),
}, nil
default:
var resp loghttp.QueryResponse
if err := resp.UnmarshalJSON(buf); err != nil {
Expand Down Expand Up @@ -1749,9 +1757,11 @@ func (p paramsRangeWrapper) End() time.Time {
func (p paramsRangeWrapper) Step() time.Duration {
return time.Duration(p.GetStep() * 1e6)
}

func (p paramsRangeWrapper) Interval() time.Duration {
return time.Duration(p.GetInterval() * 1e6)
}

func (p paramsRangeWrapper) Direction() logproto.Direction {
return p.GetDirection()
}
Expand Down
Loading