wellcomecollection / platform-infrastructure

:building_construction: Infrastructure for the Wellcome Digital Platform
MIT License
24 stars 8 forks source link

Remove min-age on deletion phase of apm_traces ILM policies #421

Closed kenoir closed 7 months ago

kenoir commented 7 months ago

What's changing and why?

This change allows indices rolled over hot to warm to be kept for 1 day, and then deleted straight away. Currently the hot phase rollover rules keep the apm_traces indices (these tend to be the largest) around for 30 days or until they reach 50GB (total disk size at present is 250GB).

The expected process is:

We reduce the max size of the hot index from 50gb to 30gb to allow expected space for 2 hot indices, the delete min_age providing us with a buffer before deletion.

For context see:

Notes on max_age & min_age

terraform plan

Terraform will perform the following actions:

  # elasticstack_elasticsearch_index_lifecycle.apm_traces will be updated in-place
  ~ resource "elasticstack_elasticsearch_index_lifecycle" "apm_traces" {
        id            = "J6V5gvONTve393_OJiiJnA/weco-traces-apm"
        name          = "weco-traces-apm"
        # (1 unchanged attribute hidden)

      ~ delete {
          ~ min_age = "10d" -> "1d"
        }

      ~ hot {
            # (1 unchanged attribute hidden)

          ~ rollover {
              ~ max_size = "50gb" -> "30gb"
                # (2 unchanged attributes hidden)
            }
        }
    }

  # elasticstack_elasticsearch_index_lifecycle.apm_traces_rum will be updated in-place
  ~ resource "elasticstack_elasticsearch_index_lifecycle" "apm_traces_rum" {
        id            = "J6V5gvONTve393_OJiiJnA/weco-traces-apm-rum"
        name          = "weco-traces-apm-rum"
        # (1 unchanged attribute hidden)

      ~ delete {
          ~ min_age = "10d" -> "1d"
        }

      ~ hot {
            # (1 unchanged attribute hidden)

          ~ rollover {
              ~ max_size = "50gb" -> "30gb"
                # (2 unchanged attributes hidden)
            }
        }
    }

Plan: 0 to add, 2 to change, 0 to destroy.

Related PRs:

Follows: https://github.com/wellcomecollection/platform-infrastructure/pull/408