From c32ae221193c60c6366be9928e4cc4778296c234 Mon Sep 17 00:00:00 2001 From: Fabian Reinartz Date: Thu, 11 Jun 2015 23:50:53 +0200 Subject: [PATCH] promql: fix missing metric in range results. --- promql/engine.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/promql/engine.go b/promql/engine.go index 990198cce..9d8036f1a 100644 --- a/promql/engine.go +++ b/promql/engine.go @@ -453,14 +453,16 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *EvalStmt) ( fp := sample.Metric.Metric.Fingerprint() ss := sampleStreams[fp] if ss == nil { - ss = &SampleStream{Values: make(metric.Values, 0, numSteps)} + ss = &SampleStream{ + Metric: sample.Metric, + Values: make(metric.Values, 0, numSteps), + } sampleStreams[fp] = ss } ss.Values = append(ss.Values, metric.SamplePair{ Value: sample.Value, Timestamp: sample.Timestamp, }) - } default: panic(fmt.Errorf("promql.Engine.exec: invalid expression type %q", val.Type()))