mimirsbrunn icon indicating copy to clipboard operation
mimirsbrunn copied to clipboard

Easier query debuging

Open antoine-de opened this issue 6 years ago • 1 comments

For the moment a bad bragi response is not easy to analyze.

you need to run bragi with debug logs (needs a restart if the log level is not the right one), check what bragi is doing (mainly if it's the prefix or ngram query that is run), and copy/paste the ES query to run in on ES (with an ui or not, and sometimes with explain=true to get the ES scores)

I feel that it would be nice to have an easier debugging path.

Do you have any ideas to make it easier ?

I see 2 ways:

pelias's way

pelias does something nice, when adding &debug=true to the query you get additional fiedls in the response with a nice debug object that contains lots of information.

it contains mainly the stack (which is more complex than in mimir), some middleware response, some timer, the ES query.

it's really helpful to understand what's going on (for an experienced user though) and it seems not difficult to implement.

I don't really know if that's nice for anyone to do this (would that make an attack easier ?)

cli tool

if we don't want anyone to do be able to have debug information (but I don't really what would need to be hidden), we might be able to add an additional mimir executable that link bragi and that log/return result.

if we do a cli tool only someone that can access the ES cluster would be able to use it and maybe we can add more information (whole ES response, change ES call to add &explain=true?), but it seems more difficult to implement since we would need to change query.rs anyway

What do you think ? Do you feel you might need something like this ? Do you see easier/better way to achieve this ?

antoine-de avatar May 16 '18 15:05 antoine-de

I like the ?debug=true it's easier and do not require access to the ES cluster. It might be a good idea to have a config toggle allowing us to disable this, typically if some people want to expose bragi directly on internet. Also I don't see why we won't be able to add the ES responses and set explain=true with this solution, it will require some change, but it is possible to do it.

kinnou02 avatar May 18 '18 07:05 kinnou02