mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
fix promtool analyze block shows metric name with 0 cardinality (#15438)
Signed-off-by: Ben Ye <benye@amazon.com>
This commit is contained in:
parent
e664c16b31
commit
40c3ba9fd4
|
@ -589,7 +589,10 @@ func analyzeBlock(ctx context.Context, path, blockID string, limit int, runExten
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
postings = index.Intersect(postings, index.NewListPostings(refs))
|
||||
// Only intersect postings if matchers are specified.
|
||||
if len(matchers) > 0 {
|
||||
postings = index.Intersect(postings, index.NewListPostings(refs))
|
||||
}
|
||||
count := 0
|
||||
for postings.Next() {
|
||||
count++
|
||||
|
|
Loading…
Reference in a new issue