Skip to content
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

Unify query frontend instant and range protobufs into one #6180

Merged
merged 1 commit into from
Sep 4, 2024

Conversation

yeya24
Copy link
Contributor

@yeya24 yeya24 commented Aug 29, 2024

What this PR does:

Unify queryfrontend instant and range query protobuf into a single protobuf. This is kind of a tech debt we introduced before. There is no need to keep two separate protobuf files for different query types as the response format is the same.

This change makes it easier to support #5527 as Querier can only have one Codec to encode response to protobuf format, instead of having two Codecs for instant and range query.

This change has no impact for migration and anything else as the protobuf types used in QFE are not even used over the wire. Just for serialization and deserialization in the same process so we can change it without worrying about backward compatibility.

Which issue(s) this PR fixes:
Fixes #

Checklist

  • Tests updated
  • Documentation added
  • CHANGELOG.md updated - the order of entries should be [CHANGE], [FEATURE], [ENHANCEMENT], [BUGFIX]

I didn't add new tests since this PR is mainly moving protobufs to another place. Existing tests should pass.

Signed-off-by: Ben Ye <benye@amazon.com>

message PrometheusData {
string ResultType = 1 [(gogoproto.jsontag) = "resultType"];
tripperware.PrometheusQueryResult Result = 2 [(gogoproto.nullable) = false, (gogoproto.jsontag) = "result"];
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the main change. Previous definition here uses repated tripperware.SampleStream which supports Matrix type only. This change makes it possible to support vector and other types so supporting both instant and range queries using the same type.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. The new PrometheusResponse is pretty much the same as what we had for PrometheusInstantQueryResponse so should be easy to use for both types.

Copy link
Contributor

@danielblando danielblando left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@yeya24 yeya24 merged commit d54cc11 into cortexproject:master Sep 4, 2024
16 checks passed
@yeya24 yeya24 deleted the unify-query-ptotos branch September 4, 2024 17:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants