Skip to content

Commit

Permalink
Remove label __name__ from store querier (#648)
Browse files Browse the repository at this point in the history
  • Loading branch information
cyriltovena authored Jun 4, 2019
1 parent 747771c commit 922f1da
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions pkg/querier/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,11 @@ func buildIterators(ctx context.Context, req *logproto.QueryRequest, chks map[mo

func buildHeapIterator(ctx context.Context, req *logproto.QueryRequest, chks [][]chunkenc.LazyChunk) (iter.EntryIterator, error) {
result := make([]iter.EntryIterator, 0, len(chks))

if chks[0][0].Chunk.Metric.Has("__name__") {
labelsBuilder := labels.NewBuilder(chks[0][0].Chunk.Metric)
labelsBuilder.Del("__name__")
chks[0][0].Chunk.Metric = labelsBuilder.Labels()
}
labels := chks[0][0].Chunk.Metric.String()

for i := range chks {
Expand Down Expand Up @@ -184,11 +188,6 @@ func partitionBySeriesChunks(chunks [][]chunk.Chunk, fetchers []*chunk.Fetcher)
for _, c := range chks {
fp := c.Fingerprint
chunksByFp[fp] = append(chunksByFp[fp], chunkenc.LazyChunk{Chunk: c, Fetcher: fetchers[i]})
if c.Metric.Has("__name__") {
labelsBuilder := labels.NewBuilder(c.Metric)
labelsBuilder.Del("__name__")
c.Metric = labelsBuilder.Labels()
}
}
}

Expand Down

0 comments on commit 922f1da

Please sign in to comment.