@@ -124,7 +124,7 @@ func TestDistributor_Push(t *testing.T) {
124124 expectedResponse * cortexpb.WriteResponse
125125 expectedError error
126126 expectedMetrics string
127- ingesterError error
127+ ingesterError error
128128 }{
129129 "A push of no samples shouldn't block or return error, even if ingesters are sad" : {
130130 numIngesters : 3 ,
@@ -204,7 +204,7 @@ func TestDistributor_Push(t *testing.T) {
204204 expectedMetrics : `
205205 # HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
206206 # 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
208208 # HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
209209 # TYPE cortex_distributor_ingester_appends_total counter
210210 cortex_distributor_ingester_appends_total{ingester="0",type="samples"} 1
@@ -223,7 +223,7 @@ func TestDistributor_Push(t *testing.T) {
223223 expectedMetrics : `
224224 # HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
225225 # 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
227227 # HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
228228 # TYPE cortex_distributor_ingester_appends_total counter
229229 cortex_distributor_ingester_appends_total{ingester="0",type="metadata"} 1
@@ -242,7 +242,7 @@ func TestDistributor_Push(t *testing.T) {
242242 expectedMetrics : `
243243 # HELP cortex_distributor_ingester_append_failures_total The total number of failed batch appends sent to ingesters.
244244 # 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
246246 # HELP cortex_distributor_ingester_appends_total The total number of batch appends sent to ingesters.
247247 # TYPE cortex_distributor_ingester_appends_total counter
248248 cortex_distributor_ingester_appends_total{ingester="0",type="metadata"} 1
@@ -1939,15 +1939,15 @@ func prepare(t *testing.T, cfg prepConfig) ([]*Distributor, []mockIngester, *rin
19391939 })
19401940 }
19411941 for i := cfg .happyIngesters ; i < cfg .numIngesters ; i ++ {
1942- mi := mockIngester {
1943- queryDelay : cfg .queryDelay ,
1944- errFail : errFail ,
1945- }
1942+ miError := errFail
19461943 if cfg .errFail != nil {
1947- mi . errFail = cfg .errFail
1944+ miError = cfg .errFail
19481945 }
19491946
1950- ingesters = append (ingesters , mi )
1947+ ingesters = append (ingesters , mockIngester {
1948+ queryDelay : cfg .queryDelay ,
1949+ failResp : miError ,
1950+ })
19511951 }
19521952
19531953 // Use a real ring with a mock KV store to test ring RF logic.
@@ -2178,7 +2178,7 @@ type mockIngester struct {
21782178 client.IngesterClient
21792179 grpc_health_v1.HealthClient
21802180 happy bool
2181- errFail error
2181+ failResp error
21822182 stats client.UsersStatsResponse
21832183 timeseries map [uint32 ]* cortexpb.PreallocTimeseries
21842184 metadata map [uint32 ]map [cortexpb.MetricMetadata ]struct {}
@@ -2217,7 +2217,7 @@ func (i *mockIngester) Push(ctx context.Context, req *cortexpb.WriteRequest, opt
22172217 i .trackCall ("Push" )
22182218
22192219 if ! i .happy {
2220- return nil , i .errFail
2220+ return nil , i .failResp
22212221 }
22222222
22232223 if i .timeseries == nil {
0 commit comments