ILM default policyedit

Index lifecycle management will manage an index based on its defined policy. The default ILM configuration applies hot and warm phase policies. Cold and delete phases are not defined. Because errors and spans lose information value faster than metrics and transactions do, there are two different policies defined: one for errors and spans, and one for metrics and transactions.

Event type Hot Warm

Errors & Spans

Rollover: max_size: 50gb, max_age: 1 day, priority: 100

min_age: 7 days, readonly, priority: 50

Transactions & Metrics

Rollover: max_size: 50gb, max_age: 7 days, priority: 100

min_age: 31 days, readonly, priority: 50

Changes to the default index lifecycle policy do not take effect until the current index has rolled over. If you’d like to manage a custom policy, see Manual ILM.

ILM default policy setupedit

To set up index lifecycle management, set ilm.enabled to true in apm-server.yml. ILM can only be enabled for output.elasticsearch. When enabled, configurations defined for output.elasticsearch.index and output.elasticsearch.indices will be ignored.

It is recommended to set up index lifecycle management (ILM) before starting APM Server. This excludes setup from the ingestion process, which allows you to ensure ILM is set up correctly before using APM.

Run the setup command with the ` --index-management` flag to set up the default ILM policy:

./apm-server setup --index-management

You can confirm the policy was created with the GET lifecycle policy API. Here’s what the transaction response looks like:

GET _ilm/policy
{
    "apm-7.2.0-transaction": {
        "version": 1,
        "modified_date": "2019-05-28T15:55:26.791Z",
        "policy": {
            "phases": {
                "warm": {
                    "min_age": "31d",
                    "actions": {
                        "readonly": {},
                        "set_priority": {
                            "priority": 50
                        }
                    }
                },
                "hot": {
                    "min_age": "0ms",
                    "actions": {
                        "rollover": {
                            "max_size": "50gb",
                            "max_age": "7d"
                        },
                        "set_priority": {
                            "priority": 100
                        }
                    }
                }
            }
        }
    }
}

Move to warm phase after 31 days

Rollover after 50gb

Rollover after 7 days

Priority for recovering your indices after a node restart. Higher priorities are recovered first.

Your indices are now configured to use index lifecycle management. Go ahead and run APM Server.

If you switch between ILM enabled/disabled multiple times, you should set setup.template.overwrite to true to ensure a complete setup.

ILM default policy upgradesedit

If you decide to customize the default ILM policy, any customizations will be overwritten when you upgrade APM Server. Default policies are also subject to change in future releases