From fdf0d0642ef0c70999f0bf5d26312318874cefb6 Mon Sep 17 00:00:00 2001 From: Brian Brazil Date: Fri, 21 Aug 2015 16:45:56 +0100 Subject: [PATCH] Cast value to float, as that's what the console templates expect. --- rules/manager.go | 4 ++-- storage/local/series.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/rules/manager.go b/rules/manager.go index 586853f4c5..5cc91a485b 100644 --- a/rules/manager.go +++ b/rules/manager.go @@ -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. diff --git a/storage/local/series.go b/storage/local/series.go index 5de11fcdae..707209872b 100644 --- a/storage/local/series.go +++ b/storage/local/series.go @@ -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), },