-
Notifications
You must be signed in to change notification settings - Fork 512
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
New internal query result payload format: add support for remote rule evaluation path #4331
Conversation
pkg/ruler/remotequerier.go
Outdated
return decodeQueryResponse(valTyp, res) | ||
level.Debug(logger).Log("msg", "query expression successfully evaluated", "qs", query, "tm", ts) | ||
|
||
contentTypeHeader := getHeader(resp, "Content-Type") |
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.
Note to reviewers: the query-frontend has always set Content-Type
to application/json
, so checking it like this with no fallback does not introduce any backwards-compatibility issues.
499aa59
to
3f8d9fb
Compare
9046553
to
4e5d9ed
Compare
4e5d9ed
to
f657daa
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.
Good job, LGTM!
9311830
to
f52aa61
Compare
…sult payload format from query-frontends.
# Conflicts: # CHANGELOG.md
…ad format in the query-frontend.
Co-authored-by: Marco Pracucci <marco@pracucci.com>
712a9a1
to
285b4b2
Compare
This PR should be good to go now, and now targets |
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.
Thanks! I just left a nit, but let's address it in a follow up PR so we already merge this one.
@@ -1571,6 +1571,11 @@ query_frontend: | |||
# ruler.query-frontend.grpc-client-config | |||
[grpc_client_config: <grpc_client>] | |||
|
|||
# (experimental) Format to use when retrieving query results from | |||
# query-frontends. Supported values: json, protobuf | |||
# CLI flag: -ruler.query-frontend.query-result-response-format |
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.
Can you also mention it in the list of experimental features under docs/sources/mimir/operators-guide/configure/about-versioning.md
? It's non blocking, you can do it in a follow up PR too.
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.
Good catch, I've created #4429 to do this.
… evaluation path (#4331) * Push decodeQueryResponse into query. * Extract createRequest method. * Extract JSON decoding to its own type. * Select decoder based on response content type. * Add configuration flag to enable requesting the new internal query result payload format from query-frontends. * Send appropriate Accept header based on configured format. * Add support for decoding responses sent in protobuf format. * Update changelog. # Conflicts: # CHANGELOG.md * Fix typo in comment. * Add support for encoding responses in the protobuf query result payload format in the query-frontend. * Refactor integration test to run a new ruler instance for each test case. * Add integration test for use of protobuf format between ruler and query-frontend. * Add benchmark. * Implement content negotiation correctly. * Rename types. * Address PR feedback: fix typos Co-authored-by: Marco Pracucci <marco@pracucci.com> * Address PR feedback: no need to take receiver * Address PR feedback: take MIME types from decoders. * Address PR feedback: rename `defaultFormatter` * Fix issue introduced during rebase on `main`. --------- Co-authored-by: Marco Pracucci <marco@pracucci.com>
What this PR does
This PR adds support for decoding the new internal query result payload format in the ruler, and encoding it in the query-frontend to send to rulers.
Which issue(s) this PR fixes or relates to
#4104
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]