-
Notifications
You must be signed in to change notification settings - Fork 816
Add protobuf codec for query range and instant query responses #5527
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
Conversation
@afhassan could you fix the DCO that's failing? |
Revisiting this PR, it looks like with the current version of Prometheus, we don't need a dedicated Prometheus handler anymore. |
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
…uerier handler Signed-off-by: Ahmed Hassan <[email protected]>
…uery and /query_range Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
…handler Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: afayek <[email protected]> Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]> Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
…eries Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[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.
Looks good! Can we update the PR title to make it more descriptive so that reviewers can understand the change? Also the PR description is outdated.
Let's also add a changelog entry
Signed-off-by: Ahmed Hassan <[email protected]>
Signed-off-by: Ahmed Hassan <[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.
https://cortexmetrics.io/docs/configuration/v1guarantees/#experimental-features
Sorry for the back and forth. Can we also mention it as an experimental feature?
Signed-off-by: Ahmed Hassan <[email protected]>
What this PR does:
This PR introduces a protobuf codec for encoding query range and instant query responses returned from Querier to Query Frontend (QFE). Protobuf encoding significantly reduces the latency between Querier and QFE for large size query response as it is much faster than json encoding. The new protobuf codec converts PromQL responses to a
PrometheusResponse
and then marshals it to Protobuf. Once the marshalled response is returned to QFE it is deserialized and merged with other responses if the query was sharded.The PR also introduces a new config to specify the response compression. Currently the supported values are
""
(no compression) or"gzip"
For unsharded instant-query requests, a JSON response is returned.
The impact on an unsharded range query with 1M samples is shown in the images below:
{__name__=~'metric_([0-9]|[1-9][0-9])'}
Before:

After:

Which issue(s) this PR fixes:
Fixes #
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]