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

Use implicit histogram format within query-frontend #4318

Conversation

charleskorn
Copy link
Contributor

@charleskorn charleskorn commented Feb 28, 2023

What this PR does

This unblocks query sharding for queries returning native histograms, and also unblocks using the new internal query result payload format between query-frontends and rulers.

With this change, queries that return native histograms will fail unless the protobuf internal query result payload format is enabled with -query-frontend.query-result-response-format=protobuf.

In addition to the main change above, there are two other small changes:

  • Using existing types when encoding and decoding matrix values, saving time and memory when decoding. The shapes of the messages are the same and so this does not change the wire format.
  • Renaming some fields to make naming consistent within mimir.proto. Again, this does not change the wire format.

I'd suggest reviewing each commit separately as the renames and type changes make the overall diff difficult to follow.

Which issue(s) this PR fixes or relates to

#4104

Checklist

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

Copy link
Collaborator

@pracucci pracucci left a comment

Choose a reason for hiding this comment

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

Good job, LGTM! Could you rebase main, please?

integration/querier_tenant_federation_test.go Outdated Show resolved Hide resolved
@@ -26,8 +26,12 @@ func TestGettingStartedWithGrafanaMimir(t *testing.T) {
defer s.Close()

require.NoError(t, copyFileToSharedDir(s, "docs/configurations/demo.yaml", "demo.yaml"))
flags := map[string]string{
// Enable protobuf format so that we can use native histograms.
"-query-frontend.query-result-response-format": "protobuf",
Copy link
Collaborator

Choose a reason for hiding this comment

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

[non blocking] I can see you're enabling it in many tests. Given this is required to get native histograms work, what if we just enable it by default in integration/configs.go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In the future, having it as a default might make sense, but for now, I'd like to leave it out so I can be confident I haven't broken the existing JSON format. WDYT?

This unblocks query sharding for queries involving native histograms,
and also unblocks using the new internal query result payload format
between query-frontends and rulers.
… matrix values.

This removes the need to convert them when decoding in the
query-frontend.

This does not change the wire format as the shapes of the messages
(Sample/MatrixSample and FloatHistogramPair/MatrixHistogram) are the
same.
@charleskorn charleskorn force-pushed the charleskorn/use-implicit-histograms-inside-query-frontend branch from 1ddf845 to c29269b Compare March 2, 2023 00:18
@charleskorn charleskorn merged commit 43e5600 into sparsehistogram Mar 2, 2023
@charleskorn charleskorn deleted the charleskorn/use-implicit-histograms-inside-query-frontend branch March 2, 2023 01:47
charleskorn added a commit that referenced this pull request Mar 3, 2023
This does not include the associated integration test changes, or
changes to tests that have not yet been merged to main.
krajorama pushed a commit that referenced this pull request Mar 7, 2023
…istogram` onto `main` (#4360)

* Cherry pick changes from #4269, #4303 and #4318 onto main.

This does not include the associated integration test changes, or
changes to tests that have not yet been merged to main.

* Add support for JSON-encoding a single series with both float and histogram values.

Co-authored-by: Ganesh Vernekar <ganeshvern@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants