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

[Task Manager] Using track_total_hits in workload agg #99360

Merged
merged 2 commits into from
May 6, 2021

Conversation

ymao1
Copy link
Contributor

@ymao1 ymao1 commented May 5, 2021

Resolves #98624

Summary

  1. Added track_total_hits: true to the workload aggregation query in order to get an accurate count of tasks.
  2. Added a size parameter to the task type term aggregation. Default size is 10 so the aggregation would never return more than 10 task types

To verify this, I created an Always Firing rule running every 15 seconds and attached some actions to it. Then I let it run for a while to build up the number of tasks. Eventually, doing a curl -X GET api/task_manager/_health should return a response like this:

{
    "id": "5b2de169-2785-441b-ae8c-186a1936b17d",
    "timestamp": "2021-05-05T17:09:00.930Z",
    "status": "OK",
    "last_update": "2021-05-05T17:08:59.839Z",
    "stats": {
        "configuration": { ... },
        "runtime": { ... },
        "workload": {
            "count": 12504,                        <---------------- this count should exceed 10,000
            "task_types": {
                  "actions:.pagerduty": {.    <----------------- there should be more than 10 task types listed
                      "count": 12480,
                      "status": {
                          "failed": 12480,
                      }
                  },
                 other task types here
            }  
        }
    }
}

@ymao1 ymao1 changed the title Using track_total_hits in workload agg [Task Manager] Using track_total_hits in workload agg May 5, 2021
@ymao1 ymao1 self-assigned this May 5, 2021
@ymao1 ymao1 added Feature:Task Manager release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.14.0 v8.0.0 labels May 5, 2021
@ymao1 ymao1 marked this pull request as ready for review May 5, 2021 17:18
@ymao1 ymao1 requested a review from a team as a code owner May 5, 2021 17:18
@elasticmachine
Copy link
Contributor

Pinging @elastic/kibana-alerting-services (Team:Alerting Services)

@ymao1 ymao1 requested a review from gmmorris May 5, 2021 17:18
@kibanamachine
Copy link
Contributor

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @ymao1

Copy link
Member

@pmuellr pmuellr left a comment

Choose a reason for hiding this comment

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

LGTM

@ymao1 ymao1 added the v7.13.0 label May 6, 2021
Copy link
Contributor

@chrisronline chrisronline left a comment

Choose a reason for hiding this comment

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

LGTM!

@ymao1 ymao1 added the auto-backport Deprecated - use backport:version if exact versions are needed label May 6, 2021
@ymao1 ymao1 merged commit 86ea803 into elastic:master May 6, 2021
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 6, 2021
* Using track_total_hits in workload agg

* Increasing size of terms aggregation
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request May 6, 2021
* Using track_total_hits in workload agg

* Increasing size of terms aggregation
@kibanamachine
Copy link
Contributor

💚 Backport successful

Status Branch Result
7.13
7.x

The backport PRs will be merged automatically after passing CI.

kibanamachine added a commit that referenced this pull request May 6, 2021
* Using track_total_hits in workload agg

* Increasing size of terms aggregation

Co-authored-by: ymao1 <ying.mao@elastic.co>
kibanamachine added a commit that referenced this pull request May 6, 2021
* Using track_total_hits in workload agg

* Increasing size of terms aggregation

Co-authored-by: ymao1 <ying.mao@elastic.co>
yctercero pushed a commit to yctercero/kibana that referenced this pull request May 11, 2021
* Using track_total_hits in workload agg

* Increasing size of terms aggregation
@ymao1 ymao1 deleted the task-manager/workload-agg branch May 19, 2021 13:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Deprecated - use backport:version if exact versions are needed Feature:Task Manager release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.13.0 v7.14.0 v8.0.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Task Manager] Workload aggregation caps out at 10k tasks
5 participants