Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Log slow queries as json, not binary. #12992

Closed
vvcephei opened this issue Aug 19, 2015 · 2 comments
Closed

Log slow queries as json, not binary. #12992

vvcephei opened this issue Aug 19, 2015 · 2 comments
Labels
:Core/Infra/Logging Log management and logging utilities discuss

Comments

@vvcephei
Copy link

In the Java client, you can compose the query either by adding String source chunks or by using another builder, like the Aggregation builder and adding the aggregation to the query. There is a quirk, though: if you use a builder, the only way to contribute it to the query is to first turn it into a byte[]. When you do this, the query ultimately gets logged as half-json, half-binary-string in the slow query log.

That isn't a problem, per se, but it's annoying when you're trying to analyze the logs.

I have no opinion about how the query objects are stored in memory, but it would be nice if the slow query log (and full query log if #9172 comes to pass) would log a human readable query.

@nik9000
Copy link
Member

nik9000 commented Aug 19, 2015

This seems like a fair request to me.

@javanna javanna added discuss :Core/Infra/Logging Log management and logging utilities labels Aug 20, 2015
@colings86
Copy link
Contributor

This is fixed by #13752 in the master branch. The search source is now stored as an object instead of as bytes and so SearchSlowLog will now print the json search request in the slow log rather than the binary bytes.

Note that until #10217 is fully complete there will still be some elements of the search request (e.g. sort parameters) which will be rendered as binary bytes since until these are refactored they are still stored in the Search request as bytes.

Closing in favour of the mentioned PRs/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Core/Infra/Logging Log management and logging utilities discuss
Projects
None yet
Development

No branches or pull requests

4 participants