Skip to content

Conversation

@MichaelScofield
Copy link
Collaborator

I hereby agree to the terms of the GreptimeDB CLA.

Refer to a related PR or issue link (optional)

What's changed and what's your intention?

following #7131
for prometheus values (http output)

also reduced some memory for storing intermediate prometheus series data

PR Checklist

Please convert it to a draft if some of the following conditions are not met.

  • I have written the necessary rustdoc comments.
  • I have added the necessary unit tests and integration tests.
  • This PR requires documentation updates.
  • API changes are backward compatible.
  • Schema or data changes are backward compatible.

@MichaelScofield MichaelScofield requested a review from a team as a code owner October 29, 2025 06:51
@github-actions github-actions bot added size/M docs-not-required This change does not impact docs. labels Oct 29, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This pull request introduces a new Column type (a wrapper around Arc<String>) to optimize memory usage in Prometheus HTTP API responses by avoiding unnecessary string cloning when column names are used as HashMap keys.

Key changes:

  • Introduced the Column type to hold Arc references to column names
  • Refactored record_batches_to_series to use a new RowWriter struct for comprehensive data type handling
  • Updated test cases to use the new Column type

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/servers/src/http/prometheus.rs Introduces Column type, adds RowWriter for row-by-row conversion with comprehensive data type support, implements trait-based column reference pattern for efficient HashMap lookups
tests-integration/tests/http.rs Updates test to import and use the new Column type in series assertions

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: luofucong <[email protected]>
@MichaelScofield MichaelScofield added this pull request to the merge queue Oct 30, 2025
Merged via the queue into main with commit 109b707 Oct 30, 2025
42 checks passed
@MichaelScofield MichaelScofield deleted the refactor/prometheus-write-arrow-directly branch October 30, 2025 10:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-not-required This change does not impact docs. size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants