diff --git a/pkg/logql/matrix.go b/pkg/logql/matrix.go index e2feaeb6bb46a..425846d78004d 100644 --- a/pkg/logql/matrix.go +++ b/pkg/logql/matrix.go @@ -44,13 +44,6 @@ func (m *MatrixStepper) Next() (bool, int64, promql.Vector) { ln := len(series.Points) if ln == 0 || series.Points[0].T != ts { - vec = append(vec, promql.Sample{ - Point: promql.Point{ - T: ts, - V: 0, - }, - Metric: series.Metric, - }) continue } diff --git a/pkg/logql/matrix_test.go b/pkg/logql/matrix_test.go index f979a0864da05..f55709df499be 100644 --- a/pkg/logql/matrix_test.go +++ b/pkg/logql/matrix_test.go @@ -45,20 +45,12 @@ func TestMatrixStepper(t *testing.T) { Point: promql.Point{T: start.UnixNano(), V: 0}, Metric: labels.Labels{{Name: "foo", Value: "bar"}}, }, - promql.Sample{ - Point: promql.Point{T: start.UnixNano(), V: 0}, - Metric: labels.Labels{{Name: "bazz", Value: "buzz"}}, - }, }, { promql.Sample{ Point: promql.Point{T: start.Add(step).UnixNano() / int64(time.Millisecond), V: 1}, Metric: labels.Labels{{Name: "foo", Value: "bar"}}, }, - promql.Sample{ - Point: promql.Point{T: start.Add(step).UnixNano() / int64(time.Millisecond), V: 0}, - Metric: labels.Labels{{Name: "bazz", Value: "buzz"}}, - }, }, { promql.Sample{ @@ -75,10 +67,6 @@ func TestMatrixStepper(t *testing.T) { Point: promql.Point{T: start.Add(3*step).UnixNano() / int64(time.Millisecond), V: 3}, Metric: labels.Labels{{Name: "foo", Value: "bar"}}, }, - promql.Sample{ - Point: promql.Point{T: start.Add(3*step).UnixNano() / int64(time.Millisecond), V: 0}, - Metric: labels.Labels{{Name: "bazz", Value: "buzz"}}, - }, }, { promql.Sample{ @@ -95,21 +83,8 @@ func TestMatrixStepper(t *testing.T) { Point: promql.Point{T: start.Add(5*step).UnixNano() / int64(time.Millisecond), V: 5}, Metric: labels.Labels{{Name: "foo", Value: "bar"}}, }, - promql.Sample{ - Point: promql.Point{T: start.Add(5*step).UnixNano() / int64(time.Millisecond), V: 0}, - Metric: labels.Labels{{Name: "bazz", Value: "buzz"}}, - }, - }, - { - promql.Sample{ - Point: promql.Point{T: start.Add(6*step).UnixNano() / int64(time.Millisecond), V: 0}, - Metric: labels.Labels{{Name: "foo", Value: "bar"}}, - }, - promql.Sample{ - Point: promql.Point{T: start.Add(6*step).UnixNano() / int64(time.Millisecond), V: 0}, - Metric: labels.Labels{{Name: "bazz", Value: "buzz"}}, - }, }, + {}, } for i := 0; i <= int(end.Sub(start)/step); i++ {