-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rule: query parameter is not encoded properly in v0.11.0 #2281
Comments
Valid, help wanted, whoever has time (: Thanks for report! cc @simonpasquier @pgier maybe? |
Just noticed. Yes please @tobiaszheller fix would be nice |
@bwplotka I have take a closer looks and it seems that it will require bigger changes: Lines 133 to 144 in 5cb3c87
EndpointsConfig component expects slice of static addresses but only single PathPrefix. I am not sure if I can modify that component without break compatibility. I saw that it also used in unmarshaling from config file, right? |
what about changing this part of the code and create one Lines 298 to 320 in 2d7b214
Something like: for _, addr := range queryAddrs {
if addr == "" {
return errors.New("static querier address cannot be empty")
}
// TODO: parse addr to extract path.
queryCfg = append(queryCfg,
query.Config{
EndpointsConfig: http_util.EndpointsConfig{
Scheme: "http",
StaticAddresses: []string{addr},
PathPrefix: path,
},
},
)
}
var fileSDConfigs []http_util.FileSDConfig
if len(querySDFiles) > 0 {
fileSDConfigs = append(fileSDConfigs, http_util.FileSDConfig{
Files: querySDFiles,
RefreshInterval: model.Duration(querySDInterval),
})
queryCfg = append(queryCfg,
query.Config{
EndpointsConfig: http_util.EndpointsConfig{
Scheme: "http",
FileSDConfigs: fileSDConfigs,
},
},
)
} |
Thanks @simonpasquier for helping, I think I agree with Simon on this. (: |
Fixed by #2288 |
Thanos, Prometheus and Golang version used:
Thanos v0.11.0
What happened:
After upgrading thanos from v0.10.0 to v.0.11.0 thanos rule has stopped working.
I am using following setting for query:
It was working fine before asking for url
http://envoy-internal:80/thanos-query/api/v1/query
.After upgrading to v0.11.0 query url with after hostname is not encoded properly:
http://envoy-internal:80%2Fthanos-query/api/v1/query
.What you expected to happen:
Encode url with path after hostname in valid way.
How to reproduce it (as minimally and precisely as possible):
This is ☝️ more or less current implementation of parsing query URL which results in following output:
http://localhost:80%2Fthanos/
I can prepare PR with fix.
The text was updated successfully, but these errors were encountered: