-
Notifications
You must be signed in to change notification settings - Fork 548
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
Remove remote read proto definitions from Mimir #8424
Conversation
b7d481f
to
bd1c2d1
Compare
message QueryRequest { | ||
// This QueryRequest message is also used for remote read requests, which includes a hints field we don't support. |
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.
Note to reviewers: previously, QueryRequest
was referenced by ReadRequest
so it was right that the field 4 (hints) was reserved. After this PR, QueryRequest
is just used internally in Mimir and it's used anymore to decode a remote read request, so we don't have any Prometheus-compatibility requirement anymore.
62ab932
to
5d15381
Compare
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.
Please add two tests to remote_read_test.go that make it explicit that the provided Step, StartMs, EndMs hints are ignored. There's already some mock storage.Querier implementations there, should be simple to do. To ensure we're not getting out of sync with assumptions in the frontend.
Protobuf comparison between Mimir and PrometheusI've just stripped comments that were not useful for the comparison purpose. ReadRequestMimir:
Prometheus:
QueryMimir:
Prometheus:
NOTE: ReadResponseMimir:
Prometheus:
QueryResponseMimir:
Prometheus:
TimeSeriesMimir:
Prometheus:
LabelPairMimir:
Prometheus:
SampleMimir:
Prometheus:
NOTE: in the case of a remote read response we never cast types, so the change in Sample field ordering doesn't matter. ExemplarMimir:
Prometheus:
Histogram@krajorama Can we skip the histogram comparison? Are they expected to be 1:1 with Prometheus ones, right? StreamReadResponseMimir:
Prometheus:
StreamChunkedSeriesMimir:
Prometheus:
StreamChunkMimir:
Prometheus:
Note: Mimir uses |
I've added the assertion to existing tests, in 677c9a3. I suggest to review changes with "hide whitespace changes". |
Yes. Although there's no explicit test for it, which is a little strange, I thought we had one. I'm adding a unit test in a different PR. |
Unit test for checking histogram equivalence: checks the names and types and order of fields, except for Gogo proto meta fields: #8426 |
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
ded700e
to
d901c16
Compare
@@ -92,8 +93,8 @@ func runBackwardCompatibilityTest(t *testing.T, previousImage string, oldFlagsMa | |||
// Push some series to Mimir. | |||
series1Timestamp := time.Now() | |||
series2Timestamp := series1Timestamp.Add(blockRangePeriod * 2) | |||
series1, expectedVector1, _ := generateFloatSeries("series_1", series1Timestamp, prompb.Label{Name: "series_1", Value: "series_1"}) | |||
series2, expectedVector2, _ := generateFloatSeries("series_2", series2Timestamp, prompb.Label{Name: "series_2", Value: "series_2"}) | |||
series1, expectedVector1, _ := generateFloatSeries("series_1", series1Timestamp, prompb.Label{Name: "label_1", Value: "label_1"}) |
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.
Note to reviewers: this change is not a fix. It just makes it easier to look at the diff in case the assertion fails, otherwise it could be misleading seeing series_1
both as metric name, and as additional key-value label pair.
@@ -1070,13 +1070,3 @@ func getMetricName(lbls []prompb.Label) string { | |||
|
|||
panic(fmt.Sprintf("series %v has no metric name", lbls)) | |||
} | |||
|
|||
func prompbLabelsToModelMetric(pbLabels []prompb.Label) model.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.
Note to reviewers: moved to integration/util.go
, close to the new utilities.
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, except test is reinventing mocking to some extent, I'll propose a PR
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
Signed-off-by: Marco Pracucci <[email protected]>
d901c16
to
688bd93
Compare
What this PR does
In Mimir we define many protobuf messages. A part from a special case, they're all used for internal Mimir communication, so it's correct that they're defined in Mimir. The special case is remote read.
The remote read endpoint works with protobuf-encoded messages. It receives in input a protobuf-encoded request and returns protobuf-encoded messages. The remote read endpoint specs are defined by Prometheus, which also defines the protobuf messages.
In Mimir, we define our own remote read protobuf messages which are essentially copy-paste of Prometheus one (except for
ReadHints
, not defined in Mimir). This may cause drifts between Prometheus and Mimir. Given the remote read endpoint is defined by Prometheus, we want to be Prometheus-compatible.To reduce risks of drifting, I would like to stop using Mimir-defined protobuf messages for the remote read endpoint. couldn't find any good reason to keep them. Prometheus already offers all the functions to convert data types (e.g. histograms) back and forth the protobuf messages.
In this PR I propose to delete Mimir-defined remote read protobuf messages and use Prometheus ones instead.
Note to reviewers:
Which issue(s) this PR fixes or relates to
N/A
Checklist
CHANGELOG.md
updated - the order of entries should be[CHANGE]
,[FEATURE]
,[ENHANCEMENT]
,[BUGFIX]
.about-versioning.md
updated with experimental features.