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

Help with slow logs getting cut off #76515

Open
nik9000 opened this issue Aug 13, 2021 · 7 comments
Open

Help with slow logs getting cut off #76515

nik9000 opened this issue Aug 13, 2021 · 7 comments
Labels
:Core/Infra/Logging Log management and logging utilities >enhancement :Search Foundations/Search Catch all for Search Foundations Team:Core/Infra Meta label for core/infra team Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch

Comments

@nik9000
Copy link
Member

nik9000 commented Aug 13, 2021

One of our key features for debugging is the slow log - but when folks have very large _searches we can end up with cut off slow logs. Something chops them. I recall that we had something to do that but I can't find it at the moment. Maybe its some external tool doing the chopping

Anyway! Maybe we could make the slow logs shorter by not outputting default parameters when we toXContent the search's source. Or something. I dunno. I've just been frustrated lately when looking at slow logs from folks that are cut off and want to do something about it.

@nik9000 nik9000 added >enhancement discuss :Search/Search Search-related issues that do not fall into other categories :Core/Infra/Logging Log management and logging utilities labels Aug 13, 2021
@elasticmachine elasticmachine added Team:Search Meta label for search team Team:Core/Infra Meta label for core/infra team labels Aug 13, 2021
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-search (Team:Search)

@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

@pgomulka
Copy link
Contributor

@nik9000 I guess you are talking about plaintext slow logs in version before 7.x? or the config is stale?
In versions <7.0 we were truncating size of the message to 1000
#36833

for indexing slow log we still truncate and it is configurable by index.indexing.slowlog.source

can you confirm the version and the provide the logging config?

@jpountz
Copy link
Contributor

jpountz commented Jan 31, 2022

We discussed it in a fix-it meeting. Having requests cut off in the slowlog is a big deal for troubleshooting production issues, and even if we had it entirely by raising the maximum length of a slowlog entry, the fact that it's so verbose makes it hard to read by a human. So the preferred route would be to stop serializing parameters when they have the default value.

We couldn't think of a component that would break if we stopped serializing default values. @nik9000 will try out by no longer serializing the size parameter of search requests to see if it breaks anything. In the case where some other components rely on having default values, we could still rely on the context that is passed to xcontent serialization so that default values would only be omitted when serializing requests to the slowlog.

nik9000 added a commit to nik9000/elasticsearch that referenced this issue Jan 31, 2022
This removes defaults from the output of the `match` query's
`toXContent`. That'll make it take up less room in the slow log. And
anywhere else is shows up.

Relates to elastic#76515
@nik9000
Copy link
Member Author

nik9000 commented Jan 31, 2022

@nik9000 will try out by no longer serializing the size parameter of search requests to see if it breaks anything. In the case where some other components rely on having default values, we could still rely on the context that is passed to xcontent serialization so that default values would only be omitted when serializing requests to the slowlog.

It looks like it's been omitting the default size for a long, long time. So I picked a common query, match, and tried to omit it's defaults. That's #83338.

nik9000 added a commit that referenced this issue Feb 11, 2022
This removes defaults from the output of the `match` query's
`toXContent`. That'll make it take up less room in the slow log. And
anywhere else is shows up.

Relates to #76515
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Feb 11, 2022
This removes the `boost` from the `toXContent` of `rank_feature` if it
is the default. It also removes the score function if it is the default.

Relates to elastic#76515
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Feb 11, 2022
This removes the defaults from the `toXContent` of the `has_child` query
so slow logs that contain it are marginally easier to read.

Relates to elastic#76515
nik9000 added a commit that referenced this issue Feb 11, 2022
This removes the `boost` from the `toXContent` of `rank_feature` if it
is the default. It also removes the score function if it is the default.

Relates to #76515
elasticsearchmachine pushed a commit that referenced this issue Feb 14, 2022
This removes the defaults from the `toXContent` of the `has_child` query
so slow logs that contain it are marginally easier to read.

Relates to #76515
nik9000 added a commit to nik9000/elasticsearch that referenced this issue Feb 14, 2022
This removes the defaults from the slow log for the remaining queries in
the `parent-join` module. So it should be easier to read the slow log
when it contains these queries.

Relates to elastic#76515
nik9000 added a commit that referenced this issue Feb 17, 2022
This removes the defaults from the slow log for the remaining queries in
the `parent-join` module. So it should be easier to read the slow log
when it contains these queries.

Relates to #76515
@nik9000
Copy link
Member Author

nik9000 commented Feb 17, 2022

nik9000 added a commit to nik9000/elasticsearch that referenced this issue Feb 17, 2022
nik9000 added a commit that referenced this issue Feb 22, 2022
probakowski pushed a commit to probakowski/elasticsearch that referenced this issue Feb 23, 2022
This removes the defaults from the slow log for the remaining queries in
the `parent-join` module. So it should be easier to read the slow log
when it contains these queries.

Relates to elastic#76515
probakowski pushed a commit to probakowski/elasticsearch that referenced this issue Feb 23, 2022
@rdnm rdnm removed the discuss label Mar 9, 2022
romseygeek added a commit that referenced this issue May 24, 2022
Mostly this is just removing boosts, but it also simplifies span_not
slightly. It also removes the boost parameter from term, as that
shares an implementation with span_term.

Relates to #76515
romseygeek added a commit that referenced this issue Jun 20, 2022
This slims down the representations of all remaining queries not in the core

* percolate
* function_score
* script_score
* pinned

Relates to #76515
@javanna javanna added :Search Foundations/Search Catch all for Search Foundations and removed :Search/Search Search-related issues that do not fall into other categories labels Jul 17, 2024
@elasticsearchmachine elasticsearchmachine added the Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch label Jul 17, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-search-foundations (Team:Search Foundations)

@elasticsearchmachine elasticsearchmachine removed the Team:Search Meta label for search team label Jul 17, 2024
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 >enhancement :Search Foundations/Search Catch all for Search Foundations Team:Core/Infra Meta label for core/infra team Team:Search Foundations Meta label for the Search Foundations team in Elasticsearch
Projects
None yet
Development

No branches or pull requests

7 participants