Add slow log support for analytics engine indexing and search paths#21884
Add slow log support for analytics engine indexing and search paths#21884himshikhagupta wants to merge 1 commit into
Conversation
PR Reviewer Guide 🔍(Review updated until commit 6506853)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to 6506853 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 4691e08
Suggestions up to commit cd3bff4
Suggestions up to commit 1f6c58a
Suggestions up to commit d84b0ac
Suggestions up to commit c81a5e1
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #21884 +/- ##
============================================
- Coverage 73.51% 73.43% -0.09%
+ Complexity 75582 75521 -61
============================================
Files 6034 6034
Lines 342661 342661
Branches 49294 49294
============================================
- Hits 251918 251627 -291
- Misses 70712 71038 +326
+ Partials 20031 19996 -35 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
6b53f82 to
9b26f6f
Compare
|
Persistent review updated to latest commit 9b26f6f |
9b26f6f to
c81a5e1
Compare
PR Code Analyzer ❗AI-powered 'Code-Diff-Analyzer' found issues on commit c81a5e1.
The table above displays the top 10 most important findings. Pull Requests Author(s): Please update your Pull Request according to the report above. Repository Maintainer(s): You can Thanks. |
|
Persistent review updated to latest commit c81a5e1 |
| String requestId | ||
| ) { | ||
| StringBuilder sb = new StringBuilder(); | ||
| sb.append("took[").append(TimeValue.timeValueNanos(tookInNanos)).append("], "); |
There was a problem hiding this comment.
Can we extend this to add critical metrics
c81a5e1 to
d84b0ac
Compare
|
Persistent review updated to latest commit d84b0ac |
d84b0ac to
1f6c58a
Compare
|
Persistent review updated to latest commit 1f6c58a |
1f6c58a to
cd3bff4
Compare
|
Persistent review updated to latest commit cd3bff4 |
@Bukhtawar this already implements AnalyticsOperationListener and covers complete query lifecycle. All wired through AnalyticsOperationListener events: onPlanningComplete → onStageSuccess → onQueryComplete for coordinator, onFragmentSuccess for data node. |
cd3bff4 to
4691e08
Compare
|
Persistent review updated to latest commit 4691e08 |
|
❌ Gradle check result for 4691e08: null Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
Wire up slow logs for the DataFusion/Parquet engine so operators can identify slow operations through the analytics path, matching the observability available on the standard Lucene search/indexing path. Indexing path: verified that the existing IndexingSlowLog fires correctly for DFA-backed indices (same IndexShard.index() listener sandwich). Search path: - AnalyticsSearchSlowLog (coordinator): logs query completions exceeding cluster.search.request.slowlog.* thresholds. Captures query source (PPL/SQL text), X-Opaque-ID, and request ID via a per-query wrapper closure pattern. - AnalyticsFragmentSlowLog (data node): logs fragment executions exceeding index.search.slowlog.threshold.query.* per-index thresholds, reading IndexSettings at call time (same settings as SearchSlowLog). Both log to the existing slow log files — no new log4j2 configuration required. Signed-off-by: Himshikha Gupta <himshikh@amazon.com>
4691e08 to
6506853
Compare
|
Persistent review updated to latest commit 6506853 |
| sb.append("took_millis[").append(TimeUnit.NANOSECONDS.toMillis(totalTookInNanos)).append("], "); | ||
| sb.append("planning_time_millis[").append(planningTimeMs).append("], "); | ||
| sb.append("stage_took_millis[{").append(stageTook).append("}], "); | ||
| sb.append("query_id[").append(queryId).append("], "); |
There was a problem hiding this comment.
How would query id be useful?
Description
Wire up slow logs for the DataFusion/Parquet engine so operators can identify slow operations through the analytics path, matching the observability available on the standard Lucene search/indexing path.
Indexing path: verified that the existing IndexingSlowLog fires correctly for DFA-backed indices
Search path (:
cluster.search.request.slowlog.*thresholds. Captures query source (PPL/SQL text), X-Opaque-ID,and request ID via a per-query wrapper closure.
index.search.slowlog.threshold.query.*per-index thresholds, reading IndexSettings at calltime -- same settings as SearchSlowLog.
Related Issues
Resolves #[Issue number to be closed when this PR is merged]
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.