From c010bf2dc7139eae823ff9735f0c2bae41e784c8 Mon Sep 17 00:00:00 2001 From: Adam Simpson Date: Wed, 20 Nov 2024 10:28:31 -0500 Subject: [PATCH] ds-querier: account for -100 meaning __expr__ (#96565) * ds-querier: account for -100 meaning __expr__ * temp debug log error parsing query * var confusion * log error --- pkg/registry/apis/query/parser.go | 2 +- pkg/registry/apis/query/query.go | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/registry/apis/query/parser.go b/pkg/registry/apis/query/parser.go index 98ae81fbd64..dabd8d46566 100644 --- a/pkg/registry/apis/query/parser.go +++ b/pkg/registry/apis/query/parser.go @@ -208,7 +208,7 @@ func (p *queryParser) getValidDataSourceRef(ctx context.Context, ds *data.DataSo if ds.UID == "" { return nil, fmt.Errorf("missing name/uid in data source reference") } - if ds.UID == expr.DatasourceType { + if expr.IsDataSource(ds.UID) { return ds, nil } if p.legacy == nil { diff --git a/pkg/registry/apis/query/query.go b/pkg/registry/apis/query/query.go index 1bbd6ef95a5..be8b24886c8 100644 --- a/pkg/registry/apis/query/query.go +++ b/pkg/registry/apis/query/query.go @@ -147,6 +147,8 @@ func (r *queryREST) Connect(connectCtx context.Context, name string, _ runtime.O }, } + b.log.Error("Error parsing query", "refId", refID, "message", message) + responder.Object(statusCode, qdr) return }