@@ -18,6 +18,7 @@ import (
1818 "go.opentelemetry.io/otel/attribute"
1919
2020 "github.com/thanos-io/thanos-parquet-gateway/internal/limits"
21+ matcherspkg "github.com/thanos-io/thanos-parquet-gateway/internal/matchers"
2122 "github.com/thanos-io/thanos-parquet-gateway/internal/tracing"
2223 "github.com/thanos-io/thanos-parquet-gateway/internal/warnings"
2324 "github.com/thanos-io/thanos-parquet-gateway/schema"
@@ -130,7 +131,7 @@ func (q ShardQuerier) LabelValues(ctx context.Context, name string, hints *stora
130131 ctx , span := tracing .Tracer ().Start (ctx , "Label Values Shard" )
131132 defer span .End ()
132133
133- span .SetAttributes (attribute .StringSlice ("matchers" , matchersToStringSlice (matchers )))
134+ span .SetAttributes (attribute .StringSlice ("matchers" , matcherspkg . ToStringSlice (matchers )))
134135 span .SetAttributes (attribute .StringSlice ("shard.replica_labels" , q .replicaLabelNames ))
135136 span .SetAttributes (attribute .String ("shard.external_labels" , q .extlabels .String ()))
136137
@@ -164,7 +165,7 @@ func (q ShardQuerier) LabelNames(ctx context.Context, hints *storage.LabelHints,
164165 ctx , span := tracing .Tracer ().Start (ctx , "Label Names Shard" )
165166 defer span .End ()
166167
167- span .SetAttributes (attribute .StringSlice ("matchers" , matchersToStringSlice (matchers )))
168+ span .SetAttributes (attribute .StringSlice ("matchers" , matcherspkg . ToStringSlice (matchers )))
168169 span .SetAttributes (attribute .StringSlice ("shard.replica_labels" , q .replicaLabelNames ))
169170 span .SetAttributes (attribute .String ("shard.external_labels" , q .extlabels .String ()))
170171
@@ -198,20 +199,12 @@ func (q ShardQuerier) Select(ctx context.Context, sorted bool, hints *storage.Se
198199 return newLazySeriesSet (ctx , q .selectFn , sorted , hints , matchers ... )
199200}
200201
201- func matchersToStringSlice (matchers []* labels.Matcher ) []string {
202- res := make ([]string , len (matchers ))
203- for i := range matchers {
204- res [i ] = matchers [i ].String ()
205- }
206- return res
207- }
208-
209202func (q ShardQuerier ) selectCore (ctx context.Context , spanName string , sorted bool , hints * storage.SelectHints , matchers ... * labels.Matcher ) ([]search.SeriesChunks , annotations.Annotations , error ) {
210203 ctx , span := tracing .Tracer ().Start (ctx , spanName )
211204 defer span .End ()
212205
213206 span .SetAttributes (attribute .Bool ("sorted" , sorted ))
214- span .SetAttributes (attribute .StringSlice ("matchers" , matchersToStringSlice (matchers )))
207+ span .SetAttributes (attribute .StringSlice ("matchers" , matcherspkg . ToStringSlice (matchers )))
215208 span .SetAttributes (attribute .StringSlice ("shard.replica_labels" , q .replicaLabelNames ))
216209 span .SetAttributes (attribute .String ("shard.external_labels" , q .extlabels .String ()))
217210
0 commit comments