-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Support post requests in the frontend queryrange handler. #2023
Conversation
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.
I'd also like to have ParseForm
done in one place (loghttp sounds good).
params.Set("query", expr.String()) | ||
req.URL.RawQuery = params.Encode() | ||
// force the form and query to be parsed again. | ||
req.Form = nil |
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'm a bit scared of setting this to nil here. I'm afraid it exposes us to issues extending this in the future -- it's easy to think the form would be parsed already. That being said, I think we should merge this. It's just something we should think about improving.
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.
Yeah I don't have a solution yet for that. The problem is that ParseForm does nothing if it's already populated and we need to update the querystring.
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.
If you remove this a test will fail.
Signed-off-by: Cyril Tovena <[email protected]>
Very nice so we will be able to do Loki alerting with this in 6.7.4 right ? |
Yes not sure when grafana change to post but this fixes alerts issue. |
Signed-off-by: Cyril Tovena [email protected]
I also took the opportunity to refactor a bit the code so that it's easier to write test and check which roundtripper is called based on a query.
I think ultimately we need to move
r.ParseForm
in theloghttp.Parse....
functions, because it's in multiple places:Fixes #2020