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

[ResponseOps][Alerting] Set .alerts-* auto-expand replicas to 0-1 #140335

Merged
merged 3 commits into from
Sep 12, 2022

Conversation

doakalexi
Copy link
Contributor

@doakalexi doakalexi commented Sep 8, 2022

Resolves #139864

Summary

Updated .alerts-* indices to have auto_expand_replicas: 0-1

Before the change, after adding an Anomaly Rule I saw the following:

GET /_cluster/health
{
  "cluster_name": "elasticsearch",
  "status": "yellow",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 11,
  "active_shards": 11,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 1,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 91.66666666666666
}

GET .alerts-observability.apm.alerts-default/_settings
{
  ".internal.alerts-observability.apm.alerts-default-000001": {
    "settings": {
      "index": {
        "lifecycle": {
          "name": ".alerts-ilm-policy",
          "rollover_alias": ".alerts-observability.apm.alerts-default"
        },
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            }
          }
        },
        "mapping": {
          "total_fields": {
            "limit": "1700"
          }
        },
        "hidden": "true",
        "number_of_shards": "1",
        "provided_name": ".internal.alerts-observability.apm.alerts-default-000001",
        "creation_date": "1662662584486",
        "number_of_replicas": "1",
        "uuid": "GoSrZY47QMWd4qviKMZvZg",
        "version": {
          "created": "8050099"
        }
      }
    }
  }
}

After the change, after adding an Anomaly Rule I saw the following:

GET /_cluster/health
{
  "cluster_name": "elasticsearch",
  "status": "green",
  "timed_out": false,
  "number_of_nodes": 1,
  "number_of_data_nodes": 1,
  "active_primary_shards": 11,
  "active_shards": 11,
  "relocating_shards": 0,
  "initializing_shards": 0,
  "unassigned_shards": 0,
  "delayed_unassigned_shards": 0,
  "number_of_pending_tasks": 0,
  "number_of_in_flight_fetch": 0,
  "task_max_waiting_in_queue_millis": 0,
  "active_shards_percent_as_number": 100
}

GET .alerts-observability.apm.alerts-default/_settings
{
  ".internal.alerts-observability.apm.alerts-default-000001": {
    "settings": {
      "index": {
        "lifecycle": {
          "name": ".alerts-ilm-policy",
          "rollover_alias": ".alerts-observability.apm.alerts-default"
        },
        "routing": {
          "allocation": {
            "include": {
              "_tier_preference": "data_content"
            }
          }
        },
        "mapping": {
          "total_fields": {
            "limit": "1700"
          }
        },
        "hidden": "true",
        "number_of_shards": "1",
        "auto_expand_replicas": "0-1",
        "provided_name": ".internal.alerts-observability.apm.alerts-default-000001",
        "creation_date": "1662663348954",
        "number_of_replicas": "0",
        "uuid": "slSS70gJQlSJolrZhOeGwg",
        "version": {
          "created": "8050099"
        }
      }
    }
  }
}

To Verify

  • Checkout main and create an Anomaly rule or any rule that uses the Rule Registry
  • Run the following commands to verify that the cluster is unhealthy
GET .alerts-observability.apm.alerts-default/_settings
GET /_cluster/health
  • Checkout this pr branch and create a rule that uses the Rule Registry
  • Run the above commands to verify that the cluster is healthy and that you see "auto_expand_replicas": "0-1"

@doakalexi doakalexi changed the title Setting auto expand replicas [ResponseOps][Alerting] Set .alerts-* auto-expand replicas to 0-1 Sep 8, 2022
@doakalexi doakalexi marked this pull request as ready for review September 8, 2022 20:04
@doakalexi doakalexi requested review from a team as code owners September 8, 2022 20:04
@doakalexi doakalexi added the Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) label Sep 9, 2022
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

Copy link
Contributor

@ymao1 ymao1 left a comment

Choose a reason for hiding this comment

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

LGTM! Verified that new .alerts indices are green after initial creation. Verified no effect on existing indices.

@doakalexi doakalexi added the backport:prev-major Backport to (8.x, 8.15) the previous major branch and all later branches still in development label Sep 12, 2022
Copy link
Member

@maryam-saeidi maryam-saeidi left a comment

Choose a reason for hiding this comment

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

LGTM! Tested it locally and the number of replicas is as expected.

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

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

@doakalexi doakalexi merged commit d2eae9f into elastic:main Sep 12, 2022
kibanamachine pushed a commit to kibanamachine/kibana that referenced this pull request Sep 12, 2022
@kibanamachine
Copy link
Contributor

💔 Some backports could not be created

Status Branch Result
7.17 Backport failed because of merge conflicts
8.4

Note: Successful backport PRs will be merged automatically after passing CI.

Manual backport

To create the backport manually run:

node scripts/backport --pr 140335

Questions ?

Please refer to the Backport tool documentation

doakalexi added a commit to doakalexi/kibana that referenced this pull request Sep 12, 2022
(cherry picked from commit d2eae9f)

# Conflicts:
#	x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts
@doakalexi
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
7.17

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

kibanamachine added a commit that referenced this pull request Sep 12, 2022
(cherry picked from commit d2eae9f)

Co-authored-by: doakalexi <109488926+doakalexi@users.noreply.github.com>
doakalexi added a commit that referenced this pull request Sep 12, 2022
(cherry picked from commit d2eae9f)

# Conflicts:
#	x-pack/plugins/rule_registry/server/rule_data_plugin_service/resource_installer.ts
yngrdyn pushed a commit to yngrdyn/kibana that referenced this pull request Sep 13, 2022
@doakalexi doakalexi deleted the alerting/auto-expand-replicas branch December 6, 2022 19:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:prev-major Backport to (8.x, 8.15) the previous major branch and all later branches still in development release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v7.17.7 v8.4.2 v8.5.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

.alerts-* auto-expand replicas 0-1
7 participants