-
Notifications
You must be signed in to change notification settings - Fork 817
Pass Request to DecodeResponse in case it is required. #1892
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
Conversation
Loki has the concept of log Direction which is essential to know when merging responses. This change allows Loki to inject the direction in the response which can be then used when merging multiple responses. Signed-off-by: Cyril Tovena <[email protected]>
c96fd0d
to
b6a8f5e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! I just left a minor comment.
@@ -198,7 +198,7 @@ func (prometheusCodec) EncodeRequest(ctx context.Context, r Request) (*http.Requ | |||
return req.WithContext(ctx), nil | |||
} | |||
|
|||
func (prometheusCodec) DecodeResponse(ctx context.Context, r *http.Response) (Response, error) { | |||
func (prometheusCodec) DecodeResponse(ctx context.Context, r *http.Response, _ Request) (Response, error) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to add a comment to this function, explaining why we have _ Request
, otherwise there's the risk we'll clean it up in the future because considered dead code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a note, but on the interface, I don't think here it matters.
Signed-off-by: Cyril Tovena <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM thanks!
Loki has the concept of log Direction which is essential to know when
merging responses. This change allows Loki to inject the direction in the
response which can be then used when merging multiple responses.
Cortex doesn't need to use this.
Signed-off-by: Cyril Tovena [email protected]