You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using thanos 0.22.0 in work, using the prometheus api /api/v1/label/<label_name>/values query label values, but thanos query always return all label values no matter what i set the match[] field, source code below.
after spending sometime digging into the source code.
according to this PR,we can use matcher to select the label values. the implementation use http.Request.From to get field match[] without calling ParseForm. http.Request.From only available after ParseForm is called. which meaning the r.Form always be empty map.
typeRequeststruct {
// Form contains the parsed form data, including both the URL// field's query parameters and the PATCH, POST, or PUT form data.// This field is `only available after ParseForm is called`.// The HTTP client ignores Form and uses Body instead.Form url.Values
}
maybe we can just call ParseFrom before get match[] to fix it.
The text was updated successfully, but these errors were encountered:
I am using thanos 0.22.0 in work, using the prometheus api /api/v1/label/<label_name>/values query label values, but thanos query always return all label values no matter what i set the
match[]
field, source code below.after spending sometime digging into the source code.
according to this PR,we can use matcher to select the label values. the implementation use
http.Request.From
to get fieldmatch[]
without callingParseForm
.http.Request.From
only available afterParseForm
is called. which meaning ther.Form
always be empty map.maybe we can just call
ParseFrom
before getmatch[]
to fix it.The text was updated successfully, but these errors were encountered: