diff --git a/pkg/query/remote_engine.go b/pkg/query/remote_engine.go index 23417fa555d..352c1b0d8d6 100644 --- a/pkg/query/remote_engine.go +++ b/pkg/query/remote_engine.go @@ -312,6 +312,9 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { } ts := msg.GetTimeseries() + if ts == nil { + continue + } builder.Reset() for _, l := range ts.Labels { builder.Add(strings.Clone(l.Name), strings.Clone(l.Value)) @@ -378,6 +381,9 @@ func (r *remoteQuery) Exec(ctx context.Context) *promql.Result { } ts := msg.GetTimeseries() + if ts == nil { + continue + } builder.Reset() for _, l := range ts.Labels { builder.Add(strings.Clone(l.Name), strings.Clone(l.Value))