@@ -124,7 +124,7 @@ func TestDistributor_Push(t *testing.T) {
124
124
expectedResponse * cortexpb.WriteResponse
125
125
expectedError error
126
126
expectedMetrics string
127
- ingesterError error
127
+ ingesterError error
128
128
}{
129
129
"A push of no samples shouldn't block or return error, even if ingesters are sad" : {
130
130
numIngesters : 3 ,
@@ -204,7 +204,7 @@ func TestDistributor_Push(t *testing.T) {
204
204
expectedMetrics : `
205
205
# HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
206
206
# TYPE cortex_distributor_ingester_append_failures_total counter
207
- cortex_distributor_ingester_append_failures_total{ingester="2",statusFamily ="5xx",type="samples"} 1
207
+ cortex_distributor_ingester_append_failures_total{ingester="2",status ="5xx",type="samples"} 1
208
208
# HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
209
209
# TYPE cortex_distributor_ingester_appends_total counter
210
210
cortex_distributor_ingester_appends_total{ingester="0",type="samples"} 1
@@ -223,7 +223,7 @@ func TestDistributor_Push(t *testing.T) {
223
223
expectedMetrics : `
224
224
# HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
225
225
# TYPE cortex_distributor_ingester_append_failures_total counter
226
- cortex_distributor_ingester_append_failures_total{ingester="2",statusFamily ="5xx",type="metadata"} 1
226
+ cortex_distributor_ingester_append_failures_total{ingester="2",status ="5xx",type="metadata"} 1
227
227
# HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
228
228
# TYPE cortex_distributor_ingester_appends_total counter
229
229
cortex_distributor_ingester_appends_total{ingester="0",type="metadata"} 1
@@ -242,7 +242,7 @@ func TestDistributor_Push(t *testing.T) {
242
242
expectedMetrics : `
243
243
# HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
244
244
# TYPE cortex_distributor_ingester_append_failures_total counter
245
- cortex_distributor_ingester_append_failures_total{ingester="2",statusFamily ="4xx",type="metadata"} 1
245
+ cortex_distributor_ingester_append_failures_total{ingester="2",status ="4xx",type="metadata"} 1
246
246
# HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
247
247
# TYPE cortex_distributor_ingester_appends_total counter
248
248
cortex_distributor_ingester_appends_total{ingester="0",type="metadata"} 1
@@ -1939,15 +1939,15 @@ func prepare(t *testing.T, cfg prepConfig) ([]*Distributor, []mockIngester, *rin
1939
1939
})
1940
1940
}
1941
1941
for i := cfg .happyIngesters ; i < cfg .numIngesters ; i ++ {
1942
- mi := mockIngester {
1943
- queryDelay : cfg .queryDelay ,
1944
- errFail : errFail ,
1945
- }
1942
+ miError := errFail
1946
1943
if cfg .errFail != nil {
1947
- mi . errFail = cfg .errFail
1944
+ miError = cfg .errFail
1948
1945
}
1949
1946
1950
- ingesters = append (ingesters , mi )
1947
+ ingesters = append (ingesters , mockIngester {
1948
+ queryDelay : cfg .queryDelay ,
1949
+ failResp : miError ,
1950
+ })
1951
1951
}
1952
1952
1953
1953
// Use a real ring with a mock KV store to test ring RF logic.
@@ -2178,7 +2178,7 @@ type mockIngester struct {
2178
2178
client.IngesterClient
2179
2179
grpc_health_v1.HealthClient
2180
2180
happy bool
2181
- errFail error
2181
+ failResp error
2182
2182
stats client.UsersStatsResponse
2183
2183
timeseries map [uint32 ]* cortexpb.PreallocTimeseries
2184
2184
metadata map [uint32 ]map [cortexpb.MetricMetadata ]struct {}
@@ -2217,7 +2217,7 @@ func (i *mockIngester) Push(ctx context.Context, req *cortexpb.WriteRequest, opt
2217
2217
i .trackCall ("Push" )
2218
2218
2219
2219
if ! i .happy {
2220
- return nil , i .errFail
2220
+ return nil , i .failResp
2221
2221
}
2222
2222
2223
2223
if i .timeseries == nil {
0 commit comments