-
Notifications
You must be signed in to change notification settings - Fork 344
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
feat: enable gzip for prometheus query handlers and ignore NaN values in prometheus response #5576
feat: enable gzip for prometheus query handlers and ignore NaN values in prometheus response #5576
Conversation
… in prometheus response
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
Documentation and Community
|
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.
LGTM
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.
LGTM 🚀
Co-authored-by: shuiyisong <113876041+shuiyisong@users.noreply.github.com>
let timestamp_millis: i64 = timestamp_column.get_data(row_index).unwrap().into(); | ||
let timestamp = timestamp_millis as f64 / 1000.0; | ||
// retrieve tags | ||
// TODO(ruihang): push table name `__metric__` |
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.
I hereby agree to the terms of the GreptimeDB CLA.
Refer to a related PR or issue link (optional)
#5525
What's changed and what's your intention?
By default, Grafana executes multiple PromQL queries within a request sequentially. However, the VictoriaMetrics datasource plugin executes them in parallel. When Grafana and the datasource are deployed in different data centers, parallel execution can significantly reduce network latency and improve query efficiency.
This PR aims to minimize retrieval overhead as much as possible.
Disable gzip, with NaN values

Response size: 186 KiB, with an 800ms gap between the first request's response and the second request.
Enable gzip, with NaN values

Response size: 24 KiB (original 186KiB), with an 440ms gap between the first request's response and the second request.
Enable gzip, without NaN values

Response size: 7 KiB (original 56KiB), with an 200ms gap between the first request's response and the second request.
PR Checklist
Please convert it to a draft if some of the following conditions are not met.