From cef3800c335993c91faf36c14387bdbad85f370a Mon Sep 17 00:00:00 2001 From: Carl Bergquist Date: Wed, 20 Dec 2017 14:20:08 +0100 Subject: [PATCH] fixes invalid valud/timestamp order --- pkg/tsdb/models/proxy/wrapper.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/pkg/tsdb/models/proxy/wrapper.go b/pkg/tsdb/models/proxy/wrapper.go index b6c9611024b..ab25412a848 100644 --- a/pkg/tsdb/models/proxy/wrapper.go +++ b/pkg/tsdb/models/proxy/wrapper.go @@ -77,8 +77,10 @@ func (tw *TsdbWrapper) Query(ctx context.Context, ds *models.DataSource, query * points := tsdb.TimeSeriesPoints{} for _, p := range s.Points { - po := tsdb.NewTimePoint(null.FloatFrom(float64(p.Timestamp.Nanos)), p.Value) - points = append(points, po) + if p.Timestamp != nil { + po := tsdb.NewTimePoint(null.FloatFrom(p.Value), float64(p.Timestamp.Seconds)) + points = append(points, po) + } } res.Results[r.RefId].Series = append(res.Results[r.RefId].Series, &tsdb.TimeSeries{