Merge pull request #1020 from prometheus/alert-templates-type

Cast value to float, as that's what the console templates expect.
pull/1025/head
Brian Brazil 2015-08-24 17:02:00 +01:00
commit 9cf123d2f0
2 changed files with 3 additions and 3 deletions

View File

@ -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.

View File

@ -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),
}, },