ds-querier: return QDR instead of k8s error (#95184)

* ds-querier: return QDR instead of k8s error

After parseQuery we know the request is a valid k8s request but we don't
know if the query is valid, therefore this change returns a QDR that
other systems, e.g. alerting ruler, can de-serialize properly.

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>

* ds-querier: fix tests

Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>

* tweak status

* refactor refID to empty

---------

Co-authored-by: Gábor Farkas <gabor.farkas@gmail.com>
Co-authored-by: Sarah Zinger <sarah.zinger@grafana.com>
This commit is contained in:
Adam Simpson
2024-10-23 09:58:22 -04:00
committed by GitHub
co-authored by Gábor Farkas Sarah Zinger
parent 008c51b5b1
commit 61b9ffd324
4 changed files with 48 additions and 23 deletions
+1 -1
View File
@@ -101,7 +101,7 @@ func (p *queryParser) parseRequest(ctx context.Context, input *query.QueryDataRe
}
exp, err := p.reader.ReadQuery(q, iter)
if err != nil {
return rsp, err
return rsp, NewErrorWithRefID(q.RefID, err)
}
exp.GraphID = int64(len(expressions) + 1)
expressions[q.RefID] = &exp