Skip to content

Commit 29782c2

Browse files
committed
rebase from stream connection
Signed-off-by: SungJin1212 <[email protected]>
1 parent 53f1195 commit 29782c2

File tree

3 files changed

+10
-11
lines changed

3 files changed

+10
-11
lines changed

docs/configuration/config-file-reference.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2768,16 +2768,16 @@ ha_tracker:
27682768
# CLI flag: -distributor.sign-write-requests
27692769
[sign_write_requests: <boolean> | default = false]
27702770
2771-
# EXPERIMENTAL: If true, accept prometheus remote write v2 protocol push
2772-
# request.
2773-
# CLI flag: -distributor.remote-write2-enabled
2774-
[remote_write2_enabled: <boolean> | default = false]
2775-
27762771
# EXPERIMENTAL: If enabled, distributor would use stream connection to send
27772772
# requests to ingesters.
27782773
# CLI flag: -distributor.use-stream-push
27792774
[use_stream_push: <boolean> | default = false]
27802775
2776+
# EXPERIMENTAL: If true, accept prometheus remote write v2 protocol push
2777+
# request.
2778+
# CLI flag: -distributor.remote-write2-enabled
2779+
[remote_write2_enabled: <boolean> | default = false]
2780+
27812781
ring:
27822782
kvstore:
27832783
# Backend storage to use for the ring. Supported values are: consul, etcd,

pkg/cortexpb/cortex.proto

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,12 @@ message StreamWriteRequest {
3636
message WriteResponse {
3737
int32 code = 1;
3838
string message = 2;
39-
}
40-
message WriteResponse {
4139
// Samples represents X-Prometheus-Remote-Write-Written-Samples
42-
int64 Samples = 1;
40+
int64 Samples = 3;
4341
// Histograms represents X-Prometheus-Remote-Write-Written-Histograms
44-
int64 Histograms = 2;
42+
int64 Histograms = 4;
4543
// Exemplars represents X-Prometheus-Remote-Write-Written-Exemplars
46-
int64 Exemplars = 3;
44+
int64 Exemplars = 5;
4745
}
4846

4947
message TimeSeries {

pkg/distributor/distributor.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,13 +1178,14 @@ func (d *Distributor) send(ctx context.Context, ingester ring.InstanceDesc, time
11781178
d.inflightClientRequests.Inc()
11791179
defer d.inflightClientRequests.Dec()
11801180

1181+
var resp *cortexpb.WriteResponse
11811182
if d.cfg.UseStreamPush {
11821183
req := &cortexpb.WriteRequest{
11831184
Timeseries: timeseries,
11841185
Metadata: metadata,
11851186
Source: source,
11861187
}
1187-
_, err = c.PushStreamConnection(ctx, req)
1188+
resp, err = c.PushStreamConnection(ctx, req)
11881189
} else {
11891190
req := cortexpb.PreallocWriteRequestFromPool()
11901191
req.Timeseries = timeseries

0 commit comments

Comments
 (0)