Skip to content

Conversation

@idrissneumann
Copy link
Collaborator

No description provided.

@idrissneumann
Copy link
Collaborator Author

idrissneumann commented Nov 24, 2023

At this stage, the errors are coming to the frontend without any message printed:

Screenshot 2023-11-24 at 13 01 22

We got the reason in the backend logs:

grafana-quickwit-datasource  | logger=context userId=1 orgId=1 uname=admin t=2023-11-24T12:01:01.010635245Z level=error msg="Internal server error" error="[plugin.downstreamError] failed to query data: Failed to query data: rpc error: code = Unknown desc = Error on multisearch: statusCode = 400, responseBody = {}, queryParam = \"max_concurrent_shard_requests=256\", requestBody = [{\"query\":{\"bool\":{\"filter\":{\"range\":{\"timestamp\":{\"gte\":\"2023-11-22T12:01:00.57Z\",\"lte\":\"2023-11-24T12:01:00.57Z\"}}}}},\"size\":100,\"sort\":[{\"timestamp\":{\"order\":\"desc\"}},{\"_doc\":{\"order\":\"desc\"}}]}]" remote_addr=192.168.247.1 traceID=

Still work in progress...

@idrissneumann idrissneumann force-pushed the feat_display_qw_errors branch 4 times, most recently from 65a0d33 to b6bc737 Compare November 25, 2023 11:49
@idrissneumann
Copy link
Collaborator Author

At this stage, the errors are accessible with the browser JS console and the http code from quickwit is propagated:

Screenshot 2023-11-25 at 12 49 56

@idrissneumann
Copy link
Collaborator Author

idrissneumann commented Nov 27, 2023

At this stage, using :

"github.com/grafana/grafana-plugin-sdk-go/experimental/errorsource"
// ...
response := backend.NewQueryDataResponse()
return errorsource.AddErrorToResponse(e.dataQueries[0].RefID, response, err), nil

We got a 200 response with empty body:

Screenshot 2023-11-27 at 15 58 45

Whereas the error is still logged on the server side:

grafana-quickwit-datasource  | logger=plugin.quickwit-quickwit-datasource t=2023-11-27T14:57:18.449939435Z level=error msg="Error on multisearch: statusCode = 400, responseBody = {}, queryParam = \"max_concurrent_shard_requests=256\", requestBody = [{\"query\":{\"bool\":{\"filter\":{\"range\":{\"timestamp\":{\"gte\":\"2023-11-27T02:57:17.995Z\",\"lte\":\"2023-11-27T14:57:17.995Z\"}}}}},\"size\":100,\"sort\":[{\"timestamp\":{\"order\":\"desc\"}},{\"_doc\":{\"order\":\"desc\"}}]}]"

Rollback for now, you can see the diff here: 9ee64fe

@idrissneumann
Copy link
Collaborator Author

At this stage, it's working pretty well :D

Screenshot 2023-11-27 at 16 09 36

@idrissneumann idrissneumann marked this pull request as ready for review November 27, 2023 15:34
@fmassot fmassot merged commit 28ebe43 into main Dec 8, 2023
@ddelemeny ddelemeny deleted the feat_display_qw_errors branch April 18, 2024 15:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants