mirror of
https://github.com/prometheus/prometheus.git
synced 2024-12-24 21:24:05 -08:00
Merge pull request #792 from prometheus/fabxc/range-fix
promql: fix missing metric in range results.
This commit is contained in:
commit
6bb5e3f8cd
|
@ -453,14 +453,16 @@ func (ng *Engine) execEvalStmt(ctx context.Context, query *query, s *EvalStmt) (
|
||||||
fp := sample.Metric.Metric.Fingerprint()
|
fp := sample.Metric.Metric.Fingerprint()
|
||||||
ss := sampleStreams[fp]
|
ss := sampleStreams[fp]
|
||||||
if ss == nil {
|
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
|
sampleStreams[fp] = ss
|
||||||
}
|
}
|
||||||
ss.Values = append(ss.Values, metric.SamplePair{
|
ss.Values = append(ss.Values, metric.SamplePair{
|
||||||
Value: sample.Value,
|
Value: sample.Value,
|
||||||
Timestamp: sample.Timestamp,
|
Timestamp: sample.Timestamp,
|
||||||
})
|
})
|
||||||
|
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
panic(fmt.Errorf("promql.Engine.exec: invalid expression type %q", val.Type()))
|
panic(fmt.Errorf("promql.Engine.exec: invalid expression type %q", val.Type()))
|
||||||
|
|
Loading…
Reference in a new issue