Merge pull request #1020 from prometheus/alert-templates-type
Cast value to float, as that's what the console templates expect.
This commit is contained in:
commit
9cf123d2f0
|
@ -198,10 +198,10 @@ func (m *Manager) queueAlertNotifications(rule *AlertingRule, timestamp model.Ti
|
|||
}
|
||||
tmplData := struct {
|
||||
Labels map[string]string
|
||||
Value model.SampleValue
|
||||
Value float64
|
||||
}{
|
||||
Labels: l,
|
||||
Value: aa.Value,
|
||||
Value: float64(aa.Value),
|
||||
}
|
||||
// Inject some convenience variables that are easier to remember for users
|
||||
// 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)
|
||||
return []model.SamplePair{
|
||||
sp1,
|
||||
model.SamplePair{
|
||||
{
|
||||
Timestamp: it.chunkIt.timestampAtIndex(0),
|
||||
Value: it.chunkIt.sampleValueAtIndex(0),
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue