mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-01 14:47:38 +00:00
adds multiple match args support for prometheusSearch, (#106)
it merges result according to prometheus ChainedSeriesMerge. https://github.com/VictoriaMetrics/VictoriaMetrics/issues/1001
This commit is contained in:
parent
9e10d5083e
commit
f5e70f0ab9
1 changed files with 9 additions and 7 deletions
|
@ -176,14 +176,16 @@ func VisitSeries(sq *storage.SearchQuery, fetchData bool, deadline searchutils.D
|
|||
return err
|
||||
}
|
||||
defer mustCloseQuerier(q)
|
||||
if len(sq.TagFilterss) != 1 {
|
||||
return fmt.Errorf("unexpected len(sq.TagFilters); got %d; want 1", len(sq.TagFilterss))
|
||||
}
|
||||
ms, err := convertTagFiltersToMatchers(sq.TagFilterss[0])
|
||||
var seriesSet []promstorage.SeriesSet
|
||||
for _, tf := range sq.TagFilterss {
|
||||
ms, err := convertTagFiltersToMatchers(tf)
|
||||
if err != nil {
|
||||
return fmt.Errorf("cannot convert tag filters to matchers: %w", err)
|
||||
}
|
||||
ss := q.Select(false, nil, ms...)
|
||||
s := q.Select(false, nil, ms...)
|
||||
seriesSet = append(seriesSet, s)
|
||||
}
|
||||
ss := promstorage.NewMergeSeriesSet(seriesSet, promstorage.ChainedSeriesMerge)
|
||||
var (
|
||||
mn storage.MetricName
|
||||
metricName []byte
|
||||
|
|
Loading…
Reference in a new issue