@@ -472,19 +472,21 @@ func Test_Series_WithLabelNameFiltering(t *testing.T) {
472472 requestLabelNames : []string {},
473473 expectedLabelNames : []string {"bar" , "foo" },
474474 },
475+ {
476+ name : "empty label names with UTF8 enabled returns ingester labels without filtering" ,
477+ allowUtf8LabelNames : true ,
478+ setCapabilities : true ,
479+ requestLabelNames : []string {},
480+ expectedLabelNames : []string {"日本語" , "bar" },
481+ },
475482 }
476483
477484 for _ , tc := range tests {
478485 t .Run (tc .name , func (t * testing.T ) {
479- foobarlabels := phlaremodel .NewLabelsBuilder (nil ).Set ("foo" , "bar" )
480-
486+ ingesterLabels := []string {"日本語" , "bar" }
481487 var capturedLabelNames []string
482488 var capturedMutex sync.Mutex
483489
484- ingesterResponse := connect .NewResponse (& ingestv1.SeriesResponse {LabelsSet : []* typesv1.Labels {
485- {Labels : foobarlabels .Labels ()},
486- }})
487-
488490 querier , err := New (& NewQuerierParams {
489491 Cfg : Config {
490492 PoolConfig : clientpool.PoolConfig {ClientCleanupPeriod : 1 * time .Millisecond },
@@ -501,8 +503,15 @@ func Test_Series_WithLabelNameFiltering(t *testing.T) {
501503 req := args .Get (1 ).(* connect.Request [ingestv1.SeriesRequest ])
502504 capturedMutex .Lock ()
503505 defer capturedMutex .Unlock ()
504- capturedLabelNames = req .Msg .LabelNames
505- }).Return (ingesterResponse , nil )
506+
507+ // If no labels passed to ingester series request,
508+ // ingester returns all ingester labels
509+ if len (req .Msg .LabelNames ) == 0 {
510+ capturedLabelNames = ingesterLabels
511+ } else {
512+ capturedLabelNames = req .Msg .LabelNames
513+ }
514+ }).Return (connect .NewResponse (& ingestv1.SeriesResponse {}), nil )
506515
507516 if len (tc .requestLabelNames ) == 0 {
508517 q .On ("LabelNames" , mock .Anything , mock .Anything ).Return (
0 commit comments