Skip to content

Commit

Permalink
fix: codec not initialized in downstream roundtripper (#12873)
Browse files Browse the repository at this point in the history
Signed-off-by: Kaviraj <kavirajkanagaraj@gmail.com>
  • Loading branch information
kavirajk authored May 3, 2024
1 parent e684ec8 commit b6049f6
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pkg/lokifrontend/frontend/config.go
Original file line number Diff line number Diff line change
@@ -43,7 +43,7 @@ func InitFrontend(cfg CombinedFrontendConfig, ring ring.ReadRing, limits v1.Limi
switch {
case cfg.DownstreamURL != "":
// If the user has specified a downstream Prometheus, then we should use that.
rt, err := NewDownstreamRoundTripper(cfg.DownstreamURL, http.DefaultTransport)
rt, err := NewDownstreamRoundTripper(cfg.DownstreamURL, http.DefaultTransport, codec)
return rt, nil, nil, err
case cfg.FrontendV2.SchedulerAddress != "" || ring != nil:
// If query-scheduler address is configured, use Frontend.
4 changes: 2 additions & 2 deletions pkg/lokifrontend/frontend/downstream_roundtripper.go
Original file line number Diff line number Diff line change
@@ -20,13 +20,13 @@ type downstreamRoundTripper struct {
codec queryrangebase.Codec
}

func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper) (queryrangebase.Handler, error) {
func NewDownstreamRoundTripper(downstreamURL string, transport http.RoundTripper, codec queryrangebase.Codec) (queryrangebase.Handler, error) {
u, err := url.Parse(downstreamURL)
if err != nil {
return nil, err
}

return &downstreamRoundTripper{downstreamURL: u, transport: transport}, nil
return &downstreamRoundTripper{downstreamURL: u, transport: transport, codec: codec}, nil
}

func (d downstreamRoundTripper) Do(ctx context.Context, req queryrangebase.Request) (queryrangebase.Response, error) {

0 comments on commit b6049f6

Please sign in to comment.