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

Search Latency Tracking - Coordinator Slow Logs #9642

Closed
dzane17 opened this issue Aug 30, 2023 · 2 comments · Fixed by #10650
Closed

Search Latency Tracking - Coordinator Slow Logs #9642

dzane17 opened this issue Aug 30, 2023 · 2 comments · Fixed by #10650
Assignees
Labels
enhancement Enhancement or improvement to existing feature or request feature New feature or request Search Search query, autocomplete ...etc v2.12.0 Issues and PRs related to version 2.12.0

Comments

@dzane17
Copy link
Contributor

dzane17 commented Aug 30, 2023

Is your feature request related to a problem? Please describe.
As of today, we track search request latencies on a shard level via node stats. After every query/fetch phase is completed on a shard, we note down the time taken for each, keep accumulating those values and maintain an overall average value which is tracked under stats.

But we don’t have a mechanism to track search latencies around coordinator node. Coordinator node plays an important role in fanning out requests to individual shard/data-nodes, aggregating those responses and eventually sending response back to the client. We have seen multiple issues in the past where it becomes hard/impossible to reason latency related issues because of lack of insights into coordinator level stats and we ended up spending a lot of unnecessary time/bandwidth on figuring it out. Clients using search API only rely on overall took time(present as part of search response) which doesn’t offer much insights into time taken by different phases.

Parent RFC: #7334

Describe the solution you'd like
Slow logs at coordinator level: As of now, we only have the capability to enable slow logs at a shard level for desired search phase(query and fetch). See this. Setting this threshold is tricky when customer usually sees latency spikes at a request level. Plus shard level slow logs doesn't offer a holistic view. So as part of this, we will also add capabilities to capture slow logs at a request level along with different search phases from coordinator node perspective.

Additional context
Coordinator slow logs will be governed by cluster settings. We will offer for the following 3 intervals:

  1. Overall request
  2. Query phase
  3. Fetch phase
// Setting on a whole request level
cluster.search.request.slowlog.threshold.warn: 10s
cluster.search.request.slowlog.threshold.info: 5s
cluster.search.request.slowlog.threshold.debug: 2s
cluster.search.request.slowlog.threshold.trace: 500ms

// Minimum level to print
cluster.search.request.slowlog.level: "trace"
@dzane17 dzane17 added enhancement Enhancement or improvement to existing feature or request untriaged labels Aug 30, 2023
@kkhatua kkhatua added feature New feature or request Search Search query, autocomplete ...etc v2.11.0 Issues and PRs related to version 2.11.0 labels Aug 30, 2023
@kkhatua kkhatua removed the untriaged label Aug 30, 2023
@dzane17 dzane17 changed the title Search Latency - Coordinator Slow Logs Search Latency Tracking - Coordinator Slow Logs Aug 30, 2023
@macohen
Copy link
Contributor

macohen commented Oct 4, 2023

Looking forward to seeing this! @dzane17 is this still slated for 2.11? Can you link a PR for this, if it is or remove the label if it isn't, please?

@kkhatua kkhatua added v2.12.0 Issues and PRs related to version 2.12.0 and removed v2.11.0 Issues and PRs related to version 2.11.0 labels Oct 16, 2023
@kkhatua kkhatua moved this from 🆕 New to Now(This Quarter) in Search Project Board Oct 16, 2023
@dzane17
Copy link
Contributor Author

dzane17 commented Oct 16, 2023

Thanks @macohen. I have opened the PR and we are now on track for 2.12

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement or improvement to existing feature or request feature New feature or request Search Search query, autocomplete ...etc v2.12.0 Issues and PRs related to version 2.12.0
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants