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

Add took time to request nodes stats #15054

Merged
merged 1 commit into from
Aug 6, 2024

Conversation

dzane17
Copy link
Contributor

@dzane17 dzane17 commented Aug 1, 2024

Description

Add overall took stats to request nodes/stats API output.

% curl -X PUT "localhost:9200/_cluster/settings?pretty&flat_settings" -H 'Content-Type: application/json' -d '{"transient" : {"search.request_stats_enabled" : true}}'
{
  "acknowledged" : true,
  "persistent" : { },
  "transient" : {
    "search.request_stats_enabled" : "true"
  }
}
% curl -XGET 'localhost:9200/_nodes/runTask-0/stats/indices/search?pretty=true'                
{
  "_nodes" : {
    "total" : 1,
    "successful" : 1,
    "failed" : 0
  },
  "cluster_name" : "runTask",
  "nodes" : {
    "BDYIv_PQS7ykbI2iGyhUMA" : {
      "timestamp" : 1722461703073,
      "name" : "runTask-0",
      "transport_address" : "127.0.0.1:9300",
      "host" : "127.0.0.1",
      "ip" : "127.0.0.1:9300",
      "roles" : [
        "cluster_manager",
        "data",
        "ingest",
        "remote_cluster_client"
      ],
      "attributes" : {
        "testattr" : "test",
        "shard_indexing_pressure_enabled" : "true"
      },
      "indices" : {
        "search" : {
          "open_contexts" : 0,
          "query_total" : 1,
          "query_time_in_millis" : 21,
          "query_current" : 0,
          "concurrent_query_total" : 0,
          "concurrent_query_time_in_millis" : 0,
          "concurrent_query_current" : 0,
          "concurrent_avg_slice_count" : 0.0,
          "fetch_total" : 1,
          "fetch_time_in_millis" : 5,
          "fetch_current" : 0,
          "scroll_total" : 0,
          "scroll_time_in_millis" : 0,
          "scroll_current" : 0,
          "point_in_time_total" : 0,
          "point_in_time_time_in_millis" : 0,
          "point_in_time_current" : 0,
          "suggest_total" : 0,
          "suggest_time_in_millis" : 0,
          "suggest_current" : 0,
          "search_idle_reactivate_count_total" : 0,
          "request" : {
            "took" : {
              "time_in_millis" : 129,
              "current" : 0,
              "total" : 1
            },
            "dfs_pre_query" : {
              "time_in_millis" : 0,
              "current" : 0,
              "total" : 0
            },
            "query" : {
              "time_in_millis" : 98,
              "current" : 0,
              "total" : 1
            },
            "fetch" : {
              "time_in_millis" : 6,
              "current" : 0,
              "total" : 1
            },
            "dfs_query" : {
              "time_in_millis" : 0,
              "current" : 0,
              "total" : 0
            },
            "expand" : {
              "time_in_millis" : 0,
              "current" : 0,
              "total" : 1
            },
            "can_match" : {
              "time_in_millis" : 0,
              "current" : 0,
              "total" : 0
            }
          }
        }
      }
    }
  }
}

Related Issues

Resolves #10768

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

Copy link
Contributor

github-actions bot commented Aug 1, 2024

❌ Gradle check result for f97cb0e: FAILURE

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?

@github-actions github-actions bot added backport 2.x Backport to 2.x branch enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Search Search query, autocomplete ...etc labels Aug 1, 2024
@dzane17 dzane17 marked this pull request as ready for review August 1, 2024 00:14
Copy link
Contributor

github-actions bot commented Aug 1, 2024

✅ Gradle check result for 295b28b: SUCCESS

Copy link

codecov bot commented Aug 1, 2024

Codecov Report

Attention: Patch coverage is 95.83333% with 1 line in your changes missing coverage. Please review.

Project coverage is 71.88%. Comparing base (b911b6f) to head (93ac279).
Report is 5 commits behind head on main.

Files Patch % Lines
...org/opensearch/index/search/stats/SearchStats.java 91.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #15054      +/-   ##
============================================
+ Coverage     71.80%   71.88%   +0.08%     
- Complexity    62775    62845      +70     
============================================
  Files          5169     5169              
  Lines        294665   294688      +23     
  Branches      42616    42616              
============================================
+ Hits         211574   211828     +254     
+ Misses        65678    65433     -245     
- Partials      17413    17427      +14     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dblock
Copy link
Member

dblock commented Aug 1, 2024

Please don't forget to add this to https://github.com/opensearch-project/opensearch-api-specification.

Copy link
Contributor

github-actions bot commented Aug 5, 2024

❌ Gradle check result for 93ac279: FAILURE

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?

@dzane17
Copy link
Contributor Author

dzane17 commented Aug 5, 2024

@jainankitk done. Looks likeRemoteMigrationIndexMetadataUpdateIT.testRemoteIndexPathFileExistsAfterMigration
is flaky #14295

Copy link
Collaborator

@jed326 jed326 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be great to get a yaml test to verify the request response looks how you want it to look but changes LGTM

Copy link
Contributor

github-actions bot commented Aug 6, 2024

❕ Gradle check result for 93ac279: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationMultiSearchDuringFetchPhase

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@jed326 jed326 merged commit 76b9931 into opensearch-project:main Aug 6, 2024
37 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-15054-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 76b9931299b4a45308b7ede4659e750eacd5006a
# Push it to GitHub
git push --set-upstream origin backport/backport-15054-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-15054-to-2.x.

@jed326
Copy link
Collaborator

jed326 commented Aug 6, 2024

@dzane17 could you please open a manual backport PR for this? And please make sure to open the api-spec PR as well.

dzane17 added a commit to dzane17/OpenSearch that referenced this pull request Aug 6, 2024
Signed-off-by: David Zane <davizane@amazon.com>
(cherry picked from commit 76b9931)
@dzane17
Copy link
Contributor Author

dzane17 commented Aug 6, 2024

Please don't forget to add this to https://github.com/opensearch-project/opensearch-api-specification.

@dblock I added a nested field in the nodes stats response, have not changed any APIs. Is api-spec needed? I noticed existing nodes stats tests don't reach the nesting depth of my change so was not what to build off of.

@jed326 jed326 added the v2.17.0 label Aug 6, 2024
jed326 pushed a commit that referenced this pull request Aug 6, 2024
Signed-off-by: David Zane <davizane@amazon.com>
(cherry picked from commit 76b9931)

Signed-off-by: David Zane <38449481+dzane17@users.noreply.github.com>
jed326 pushed a commit to jed326/OpenSearch that referenced this pull request Aug 7, 2024
@jed326 jed326 mentioned this pull request Aug 7, 2024
jed326 added a commit to jed326/OpenSearch that referenced this pull request Aug 7, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
jed326 added a commit that referenced this pull request Aug 7, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
@dblock
Copy link
Member

dblock commented Aug 7, 2024

Please don't forget to add this to https://github.com/opensearch-project/opensearch-api-specification.

@dblock I added a nested field in the nodes stats response, have not changed any APIs. Is api-spec needed? I noticed existing nodes stats tests don't reach the nesting depth of my change so was not what to build off of.

It adds a new field to the response object, right? Therefore it's an API change (albeit a backwards compatible one).

Def add a test that reaches deeper!

harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Aug 20, 2024
Signed-off-by: David Zane <davizane@amazon.com>
harshavamsi pushed a commit to harshavamsi/OpenSearch that referenced this pull request Aug 20, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
Signed-off-by: David Zane <davizane@amazon.com>
wdongyu pushed a commit to wdongyu/OpenSearch that referenced this pull request Aug 22, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
Signed-off-by: David Zane <davizane@amazon.com>
akolarkunnu pushed a commit to akolarkunnu/OpenSearch that referenced this pull request Sep 10, 2024
Signed-off-by: Jay Deng <jayd0104@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch backport-failed enhancement Enhancement or improvement to existing feature or request good first issue Good for newcomers Search Search query, autocomplete ...etc v2.17.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search stats for coordinator node misses total search request time
4 participants