Add ILM policy for new stack monitoring data streams#82498
Add ILM policy for new stack monitoring data streams#82498jbaiera merged 13 commits intoelastic:masterfrom
Conversation
|
Pinging @elastic/es-data-management (Team:Data Management) |
|
relates to #81839 |
dakrone
left a comment
There was a problem hiding this comment.
Generally looks good, I left a couple of comments.
Can you also add a test for this similar to what we do for StackTemplateRegistryTests? That way we can test the duration copying from the setting into the ILM policy and ensure it works correctly.
...k/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java
Outdated
Show resolved
Hide resolved
x-pack/plugin/core/src/main/resources/monitoring-mb-ilm-policy.json
Outdated
Show resolved
Hide resolved
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
|
@elasticmachine update branch |
dakrone
left a comment
There was a problem hiding this comment.
LGTM, I left two suuuper minor things
...toring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistryTests.java
Outdated
Show resolved
Hide resolved
...toring/src/test/java/org/elasticsearch/xpack/monitoring/MonitoringTemplateRegistryTests.java
Outdated
Show resolved
Hide resolved
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com>
|
Reviewing this made me notice we're going to need a monitoring-entsearch as well. Looks like the mapping isn't there atm anyway so we'll just have to remember to include ILM when we add it (probably as part of elastic/kibana#121975) |
matschaffer
left a comment
There was a problem hiding this comment.
I gave this a try locally and LGTM
|
@elasticmachine update branch |
Adds a templated ILM policy with a 3 day or 50 gb rollover and a 3 day retention period by default. The retention period checks the value set in xpack.monitoring.history.duration and uses that for the retention period if it is present. Depending on which default it uses, the _meta field is updated with the reasoning for picking the default retention value. Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com> # Conflicts: # x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/LifecyclePolicyConfig.java # x-pack/plugin/ml/qa/native-multi-node-tests/src/javaRestTest/java/org/elasticsearch/xpack/ml/integration/MlNativeIntegTestCase.java
* Upgrade documentation for xpack.monitoring.history.duration * A few updates now that #82498 has been opened with a concrete policy. * Grammar fix * Update docs/reference/migration/migrate_8_0/cluster-node-setting-changes.asciidoc Co-authored-by: James Baiera <james.baiera@gmail.com> Co-authored-by: James Baiera <james.baiera@gmail.com>
…82295) * Upgrade documentation for xpack.monitoring.history.duration * A few updates now that elastic#82498 has been opened with a concrete policy. * Grammar fix * Update docs/reference/migration/migrate_8_0/cluster-node-setting-changes.asciidoc Co-authored-by: James Baiera <james.baiera@gmail.com> Co-authored-by: James Baiera <james.baiera@gmail.com>
…82920) * Upgrade documentation for xpack.monitoring.history.duration * A few updates now that #82498 has been opened with a concrete policy. * Grammar fix * Update docs/reference/migration/migrate_8_0/cluster-node-setting-changes.asciidoc Co-authored-by: James Baiera <james.baiera@gmail.com> Co-authored-by: James Baiera <james.baiera@gmail.com> Co-authored-by: James Baiera <james.baiera@gmail.com>
…82892) Adds a templated ILM policy with a 3 day or 50 gb rollover and a 3 day retention period by default. The retention period checks the value set in xpack.monitoring.history.duration and uses that for the retention period if it is present. Depending on which default it uses, the _meta field is updated with the reasoning for picking the default retention value. Co-authored-by: Lee Hinman <dakrone@users.noreply.github.com> Co-authored-by: Elastic Machine <elasticmachine@users.noreply.github.com>
Adds a templated ILM policy with a 3 day or 50 gb rollover and a 3 day retention period by default. The retention period checks the value set in
xpack.monitoring.history.durationand uses that for the retention period if it is present. Depending on which default it uses, the_metafield is updated with the reasoning for picking the default retention value:The defaults
{ ".monitoring-8-ilm-policy": { "version": 1, "modified_date": "2022-01-12T21:53:55.278Z", "policy": { "phases": { "warm": { "min_age": "0ms", "actions": { "forcemerge": { "max_num_segments": 1 } } }, "hot": { "min_age": "0ms", "actions": { "rollover": { "max_primary_shard_size": "50gb", "max_age": "3d" } } }, "delete": { "min_age": "3d", "actions": { "delete": { "delete_searchable_snapshot": true } } } }, "_meta": { "defaults": { "delete_min_age": "Using value of [3d] based on the monitoring plugin default" }, "managed": true, "description": "Index lifecycle policy generated for [monitoring-*-8] data streams" } }, "in_use_by": { "indices": [], "data_streams": [], "composable_templates": [ ".monitoring-beats-mb", ".monitoring-kibana-mb", ".monitoring-es-mb", ".monitoring-logstash-mb" ] } } }Setting
xpack.monitoring.history.durationto the value4dat start up{ ".monitoring-8-ilm-policy": { "version": 1, "modified_date": "2022-01-12T20:42:01.835Z", "policy": { "phases": { "warm": { "min_age": "0ms", "actions": { "forcemerge": { "max_num_segments": 1 } } }, "hot": { "min_age": "0ms", "actions": { "rollover": { "max_primary_shard_size": "50gb", "max_age": "3d" } } }, "delete": { "min_age": "4d", "actions": { "delete": { "delete_searchable_snapshot": true } } } }, "_meta": { "defaults": { "delete_min_age": "Using value of [4d] based on the value of the [xpack.monitoring.history.duration] setting at node startup" }, "managed": true, "description": "Index lifecycle policy generated for [monitoring-*-8] data streams" } }, "in_use_by": { "indices": [], "data_streams": [], "composable_templates": [ ".monitoring-beats-mb", ".monitoring-kibana-mb", ".monitoring-es-mb", ".monitoring-logstash-mb" ] } } }Also included is a small enhancement to allow for template variable replacement in ILM policy resource files.