Skip to content

Commit 76b68c1

Browse files
committed
Registering counter for dropped metrics in test
Signed-off-by: Pedro Tanaka <[email protected]>
1 parent 7112549 commit 76b68c1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pkg/distributor/distributor_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2779,6 +2779,7 @@ func TestDistributor_Push_RelabelDropWillExportMetricOfDroppedSamples(t *testing
27792779
limits: &limits,
27802780
})
27812781

2782+
regs[0].MustRegister(validation.DiscardedSamples)
27822783
validation.DiscardedSamples.Reset()
27832784

27842785
// Push the series to the distributor
@@ -2799,7 +2800,7 @@ func TestDistributor_Push_RelabelDropWillExportMetricOfDroppedSamples(t *testing
27992800
expectedMetrics := `
28002801
# HELP cortex_discarded_samples_total The total number of samples that were discarded.
28012802
# TYPE cortex_discarded_samples_total counter
2802-
cortex_discarded_samples_total{reason="relabel_configuration",user="user"} 1
2803+
cortex_discarded_samples_total{reason="relabel_configuration",user="user1"} 1
28032804
# HELP cortex_distributor_received_samples_total The total number of received samples, excluding rejected and deduped samples.
28042805
# TYPE cortex_distributor_received_samples_total counter
28052806
cortex_distributor_received_samples_total{user="user1"} 1

0 commit comments

Comments
 (0)