mirror of https://github.com/prometheus/prometheus
Merge pull request #1020 from prometheus/alert-templates-type
Cast value to float, as that's what the console templates expect.pull/1025/head
commit
9cf123d2f0
|
@ -198,10 +198,10 @@ func (m *Manager) queueAlertNotifications(rule *AlertingRule, timestamp model.Ti
|
||||||
}
|
}
|
||||||
tmplData := struct {
|
tmplData := struct {
|
||||||
Labels map[string]string
|
Labels map[string]string
|
||||||
Value model.SampleValue
|
Value float64
|
||||||
}{
|
}{
|
||||||
Labels: l,
|
Labels: l,
|
||||||
Value: aa.Value,
|
Value: float64(aa.Value),
|
||||||
}
|
}
|
||||||
// Inject some convenience variables that are easier to remember for users
|
// Inject some convenience variables that are easier to remember for users
|
||||||
// who are not used to Go's templating system.
|
// who are not used to Go's templating system.
|
||||||
|
|
|
@ -533,7 +533,7 @@ func (it *memorySeriesIterator) ValueAtTime(t model.Time) []model.SamplePair {
|
||||||
it.chunkIt = it.chunkIterator(l - i + 1)
|
it.chunkIt = it.chunkIterator(l - i + 1)
|
||||||
return []model.SamplePair{
|
return []model.SamplePair{
|
||||||
sp1,
|
sp1,
|
||||||
model.SamplePair{
|
{
|
||||||
Timestamp: it.chunkIt.timestampAtIndex(0),
|
Timestamp: it.chunkIt.timestampAtIndex(0),
|
||||||
Value: it.chunkIt.sampleValueAtIndex(0),
|
Value: it.chunkIt.sampleValueAtIndex(0),
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue