@@ -188,7 +188,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
188188 {
189189 name : "test handler with stats enabled" ,
190190 cfg : HandlerConfig {QueryStatsEnabled : true },
191- expectedMetrics : 3 ,
191+ expectedMetrics : 4 ,
192192 roundTripperFunc : roundTripper ,
193193 expectedStatusCode : http .StatusOK ,
194194 },
@@ -202,7 +202,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
202202 {
203203 name : "test handler with reasonResponseTooLarge" ,
204204 cfg : HandlerConfig {QueryStatsEnabled : true },
205- expectedMetrics : 3 ,
205+ expectedMetrics : 4 ,
206206 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
207207 return & http.Response {
208208 StatusCode : http .StatusRequestEntityTooLarge ,
@@ -218,7 +218,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
218218 {
219219 name : "test handler with reasonTooManyRequests" ,
220220 cfg : HandlerConfig {QueryStatsEnabled : true },
221- expectedMetrics : 3 ,
221+ expectedMetrics : 4 ,
222222 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
223223 return & http.Response {
224224 StatusCode : http .StatusTooManyRequests ,
@@ -234,7 +234,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
234234 {
235235 name : "test handler with reasonTooManySamples" ,
236236 cfg : HandlerConfig {QueryStatsEnabled : true },
237- expectedMetrics : 3 ,
237+ expectedMetrics : 4 ,
238238 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
239239 return & http.Response {
240240 StatusCode : http .StatusUnprocessableEntity ,
@@ -250,7 +250,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
250250 {
251251 name : "test handler with reasonTooLongRange" ,
252252 cfg : HandlerConfig {QueryStatsEnabled : true },
253- expectedMetrics : 3 ,
253+ expectedMetrics : 4 ,
254254 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
255255 return & http.Response {
256256 StatusCode : http .StatusUnprocessableEntity ,
@@ -266,7 +266,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
266266 {
267267 name : "test handler with reasonSeriesFetched" ,
268268 cfg : HandlerConfig {QueryStatsEnabled : true },
269- expectedMetrics : 3 ,
269+ expectedMetrics : 4 ,
270270 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
271271 return & http.Response {
272272 StatusCode : http .StatusUnprocessableEntity ,
@@ -282,7 +282,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
282282 {
283283 name : "test handler with reasonChunksFetched" ,
284284 cfg : HandlerConfig {QueryStatsEnabled : true },
285- expectedMetrics : 3 ,
285+ expectedMetrics : 4 ,
286286 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
287287 return & http.Response {
288288 StatusCode : http .StatusUnprocessableEntity ,
@@ -298,7 +298,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
298298 {
299299 name : "test handler with reasonChunkBytesFetched" ,
300300 cfg : HandlerConfig {QueryStatsEnabled : true },
301- expectedMetrics : 3 ,
301+ expectedMetrics : 4 ,
302302 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
303303 return & http.Response {
304304 StatusCode : http .StatusUnprocessableEntity ,
@@ -314,7 +314,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
314314 {
315315 name : "test handler with reasonDataBytesFetched" ,
316316 cfg : HandlerConfig {QueryStatsEnabled : true },
317- expectedMetrics : 3 ,
317+ expectedMetrics : 4 ,
318318 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
319319 return & http.Response {
320320 StatusCode : http .StatusUnprocessableEntity ,
@@ -330,7 +330,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
330330 {
331331 name : "test handler with reasonSeriesLimitStoreGateway" ,
332332 cfg : HandlerConfig {QueryStatsEnabled : true },
333- expectedMetrics : 3 ,
333+ expectedMetrics : 4 ,
334334 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
335335 return & http.Response {
336336 StatusCode : http .StatusUnprocessableEntity ,
@@ -346,7 +346,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
346346 {
347347 name : "test handler with reasonChunksLimitStoreGateway" ,
348348 cfg : HandlerConfig {QueryStatsEnabled : true },
349- expectedMetrics : 3 ,
349+ expectedMetrics : 4 ,
350350 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
351351 return & http.Response {
352352 StatusCode : http .StatusUnprocessableEntity ,
@@ -362,7 +362,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
362362 {
363363 name : "test handler with reasonBytesLimitStoreGateway" ,
364364 cfg : HandlerConfig {QueryStatsEnabled : true },
365- expectedMetrics : 3 ,
365+ expectedMetrics : 4 ,
366366 roundTripperFunc : roundTripperFunc (func (req * http.Request ) (* http.Response , error ) {
367367 return & http.Response {
368368 StatusCode : http .StatusUnprocessableEntity ,
@@ -393,6 +393,7 @@ func TestHandler_ServeHTTP(t *testing.T) {
393393 reg ,
394394 "cortex_query_seconds_total" ,
395395 "cortex_query_fetched_series_total" ,
396+ "cortex_query_samples_total" ,
396397 "cortex_query_fetched_chunks_bytes_total" ,
397398 )
398399
0 commit comments