From 82df2fa47b092d1364ad9965e994a28056b33c3c Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Mon, 2 Sep 2024 12:59:21 +0100 Subject: [PATCH 1/2] [plugin/apm-data] Use component-templates to configure fallback to ILM --- .../logs-apm.app-fallback@lifecycle.yaml | 11 ++++++++++ .../logs-apm.error-fallback@lifecycle.yaml | 11 ++++++++++ .../metrics-apm.app-fallback@lifecycle.yaml | 11 ++++++++++ ...trics-apm.internal-fallback@lifecycle.yaml | 11 ++++++++++ ...ce_destination.10m-fallback@lifecycle.yaml | 11 ++++++++++ ...ice_destination.1m-fallback@lifecycle.yaml | 11 ++++++++++ ...ce_destination.60m-fallback@lifecycle.yaml | 11 ++++++++++ ...ervice_summary.10m-fallback@lifecycle.yaml | 11 ++++++++++ ...service_summary.1m-fallback@lifecycle.yaml | 11 ++++++++++ ...ervice_summary.60m-fallback@lifecycle.yaml | 11 ++++++++++ ...ce_transaction.10m-fallback@lifecycle.yaml | 11 ++++++++++ ...ice_transaction.1m-fallback@lifecycle.yaml | 11 ++++++++++ ...ce_transaction.60m-fallback@lifecycle.yaml | 11 ++++++++++ ...pm.transaction.10m-fallback@lifecycle.yaml | 11 ++++++++++ ...apm.transaction.1m-fallback@lifecycle.yaml | 11 ++++++++++ ...pm.transaction.60m-fallback@lifecycle.yaml | 11 ++++++++++ .../traces-apm-fallback@lifecycle.yaml | 11 ++++++++++ .../traces-apm.rum-fallback@lifecycle.yaml | 11 ++++++++++ ...traces-apm.sampled-fallback@lifecycle.yaml | 11 ++++++++++ .../logs-apm.app@template.yaml | 1 + .../logs-apm.error@template.yaml | 1 + .../metrics-apm.app@template.yaml | 1 + .../metrics-apm.internal@template.yaml | 1 + ...-apm.service_destination.10m@template.yaml | 1 + ...s-apm.service_destination.1m@template.yaml | 1 + ...-apm.service_destination.60m@template.yaml | 1 + ...rics-apm.service_summary.10m@template.yaml | 1 + ...trics-apm.service_summary.1m@template.yaml | 1 + ...rics-apm.service_summary.60m@template.yaml | 1 + ...-apm.service_transaction.10m@template.yaml | 1 + ...s-apm.service_transaction.1m@template.yaml | 1 + ...-apm.service_transaction.60m@template.yaml | 1 + .../metrics-apm.transaction.10m@template.yaml | 1 + .../metrics-apm.transaction.1m@template.yaml | 1 + .../metrics-apm.transaction.60m@template.yaml | 1 + .../traces-apm.rum@template.yaml | 1 + .../traces-apm.sampled@template.yaml | 1 + .../index-templates/traces-apm@template.yaml | 1 + .../src/main/resources/resources.yaml | 20 +++++++++++++++++++ 39 files changed, 248 insertions(+) create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml create mode 100644 x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..9d49bb027c217 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for logs-apm.app if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: logs-apm.app_logs-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..b3e2bd2a631a9 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for logs-apm.error if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: logs-apm.error_logs-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..99acbea08ec04 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.app if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.app_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..cbc93e77bc1b0 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.internal if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.internal_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..8395cc713fd5e --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_destination.10m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_destination_10m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..81f3a5da9803d --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_destination.1m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_destination_1m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..5278114a7cc1f --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_destination.60m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_destination_60m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..18752839eba47 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_summary.10m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_summary_10m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..118b76438e763 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_summary.1m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_summary_1m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..c0d825d6cbb31 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_summary.60m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_summary_60m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..7f4c0310ed007 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_transaction.10m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_transaction_10m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..44ea69d476954 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_transaction.1m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_transaction_1m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..5be8368ab1efb --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.service_transaction.60m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.service_transaction_60m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..6bd837af53e79 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.transaction.10m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.transaction_10m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..468dff5b81a8d --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.transaction.1m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.transaction_1m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..17cf9c3316200 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for metrics-apm.transaction.60m if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: metrics-apm.transaction_60m_metrics-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..7febfb0dbdd1e --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for traces-apm if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: traces-apm.traces-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..3c894601f6717 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for traces-apm.rum if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: traces-apm.rum_traces-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml new file mode 100644 index 0000000000000..bd892f8e64e83 --- /dev/null +++ b/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml @@ -0,0 +1,11 @@ +--- +version: ${xpack.apmdata.template.version} +_meta: + description: Fallback to ILM policy for traces-apm.sampled if DSL not defined + managed: true +template: + settings: + index: + lifecycle: + name: traces-apm.sampled_traces-default_policy + prefer_ilm: false diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.app@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.app@template.yaml index 21cad50f3fe90..5e51decdb9e53 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.app@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.app@template.yaml @@ -12,6 +12,7 @@ composed_of: - apm@settings - apm-10d@lifecycle - logs-apm@settings +- logs-apm.app-fallback@lifecycle - logs@custom - logs-apm.app@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.error@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.error@template.yaml index 2cfa7b454722f..79ec99de768c8 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.error@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/logs-apm.error@template.yaml @@ -14,6 +14,7 @@ composed_of: - apm-10d@lifecycle - logs-apm@settings - logs-apm.error@mappings +- logs-apm.error-fallback@lifecycle - logs@custom - logs-apm.error@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.app@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.app@template.yaml index a3c7ab7c05193..cde7464833ea3 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.app@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.app@template.yaml @@ -13,6 +13,7 @@ composed_of: - apm-90d@lifecycle - metrics-apm@mappings - metrics-apm@settings +- metrics-apm.app-fallback@lifecycle - metrics@custom - metrics-apm.app@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.internal@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.internal@template.yaml index 4c7df377a6cfa..6dde1152860cb 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.internal@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.internal@template.yaml @@ -14,6 +14,7 @@ composed_of: - apm-90d@lifecycle - metrics-apm@mappings - metrics-apm@settings +- metrics-apm.internal-fallback@lifecycle - metrics@custom - metrics-apm.internal@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml index 63c9ff9c3b988..e5ad65886d1df 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_destination@mappings +- metrics-apm.service_destination.10m-fallback@lifecycle - metrics@custom - metrics-apm.service_destination.10m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml index 6995a2d09b12e..a0a12cd61fb08 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml @@ -15,6 +15,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_destination@mappings +- metrics-apm.service_destination.1m-fallback@lifecycle - metrics@custom - metrics-apm.service_destination.1m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml index b39d0beca3740..0890213b05b2d 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_destination@mappings +- metrics-apm.service_destination.60m-fallback@lifecycle - metrics@custom - metrics-apm.service_destination.60m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml index 8d92b21866bb8..9ec77289b886a 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_summary@mappings +- metrics-apm.service_summary.10m-fallback@lifecycle - metrics@custom - metrics-apm.service_summary.10m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml index de19df330aa0e..f17e241be19b3 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml @@ -15,6 +15,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_summary@mappings +- metrics-apm.service_summary.1m-fallback@lifecycle - metrics@custom - metrics-apm.service_summary.1m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml index 002676eb08cc1..3253991bac4b7 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_summary@mappings +- metrics-apm.service_summary.60m-fallback@lifecycle - metrics@custom - metrics-apm.service_summary.60m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml index 549af3942dcd3..12b4d49629c9d 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_transaction@mappings +- metrics-apm.service_transaction.10m-fallback@lifecycle - metrics@custom - metrics-apm.service_transaction.10m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml index 9bdacfc337663..07d2764096a81 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml @@ -15,6 +15,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_transaction@mappings +- metrics-apm.service_transaction.1m-fallback@lifecycle - metrics@custom - metrics-apm.service_transaction.1m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml index 8bcbeb53c74fe..5a6df8166eaf2 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.service_transaction@mappings +- metrics-apm.service_transaction.60m-fallback@lifecycle - metrics@custom - metrics-apm.service_transaction.60m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml index 68c1dc0f31c1e..d9a07e2913e97 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.transaction@mappings +- metrics-apm.transaction.10m-fallback@lifecycle - metrics@custom - metrics-apm.transaction.10m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml index 6065f6e12f999..9a417db1b480b 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml @@ -15,6 +15,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.transaction@mappings +- metrics-apm.transaction.1m-fallback@lifecycle - metrics@custom - metrics-apm.transaction.1m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml index d8889ceb63f87..849eb150b51ea 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml @@ -16,6 +16,7 @@ composed_of: - metrics-apm@mappings - metrics-apm@settings - metrics-apm.transaction@mappings +- metrics-apm.transaction.60m-fallback@lifecycle - metrics@custom - metrics-apm.transaction.60m@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.rum@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.rum@template.yaml index d299481ff6e21..c6690d5087166 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.rum@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.rum@template.yaml @@ -14,6 +14,7 @@ composed_of: - apm-90d@lifecycle - traces-apm@mappings - traces-apm.rum@mappings +- traces-apm.rum-fallback@lifecycle - traces@custom - traces-apm.rum@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.sampled@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.sampled@template.yaml index 81457e2f204cb..cc0676b30abba 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.sampled@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm.sampled@template.yaml @@ -11,6 +11,7 @@ composed_of: - traces@mappings - apm@mappings - apm@settings +- traces-apm.sampled-fallback@lifecycle - traces@custom - traces-apm.sampled@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm@template.yaml b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm@template.yaml index fda953171b793..bac1fedfb09cc 100644 --- a/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm@template.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/index-templates/traces-apm@template.yaml @@ -13,6 +13,7 @@ composed_of: - apm@settings - apm-10d@lifecycle - traces-apm@mappings +- traces-apm-fallback@lifecycle - traces@custom - traces-apm@custom - ecs@mappings diff --git a/x-pack/plugin/apm-data/src/main/resources/resources.yaml b/x-pack/plugin/apm-data/src/main/resources/resources.yaml index 0502a8c559ff6..2d6a3e4c47939 100644 --- a/x-pack/plugin/apm-data/src/main/resources/resources.yaml +++ b/x-pack/plugin/apm-data/src/main/resources/resources.yaml @@ -25,6 +25,26 @@ component-templates: - metrics-apm.transaction@mappings - traces-apm@mappings - traces-apm.rum@mappings + # Fallback to ILM if DSL configurations are not present + - logs-apm.app-fallback@lifecycle + - logs-apm.error-fallback@lifecycle + - metrics-apm.app-fallback@lifecycle + - metrics-apm.internal-fallback@lifecycle + - metrics-apm.service_destination.10m-fallback@lifecycle + - metrics-apm.service_destination.1m-fallback@lifecycle + - metrics-apm.service_destination.60m-fallback@lifecycle + - metrics-apm.service_summary.10m-fallback@lifecycle + - metrics-apm.service_summary.1m-fallback@lifecycle + - metrics-apm.service_summary.60m-fallback@lifecycle + - metrics-apm.service_transaction.10m-fallback@lifecycle + - metrics-apm.service_transaction.1m-fallback@lifecycle + - metrics-apm.service_transaction.60m-fallback@lifecycle + - metrics-apm.transaction.10m-fallback@lifecycle + - metrics-apm.transaction.1m-fallback@lifecycle + - metrics-apm.transaction.60m-fallback@lifecycle + - traces-apm-fallback@lifecycle + - traces-apm.rum-fallback@lifecycle + - traces-apm.sampled-fallback@lifecycle index-templates: - logs-apm.app@template From 079cc34f8f1cb19db54aecfc4b59cd27731264a9 Mon Sep 17 00:00:00 2001 From: Vishal Raj Date: Fri, 6 Sep 2024 20:28:11 +0100 Subject: [PATCH 2/2] [plugin/apm-data] Allow fallback of templates to template-resources --- .../xpack/core/template/ResourceUtils.java | 10 ++++++++-- .../xpack/core/template/YamlTemplateRegistry.java | 4 ++-- .../logs-apm.app-fallback@lifecycle.yaml | 0 .../logs-apm.error-fallback@lifecycle.yaml | 0 .../metrics-apm.app-fallback@lifecycle.yaml | 0 .../metrics-apm.internal-fallback@lifecycle.yaml | 0 ...apm.service_destination.10m-fallback@lifecycle.yaml | 0 ...-apm.service_destination.1m-fallback@lifecycle.yaml | 0 ...apm.service_destination.60m-fallback@lifecycle.yaml | 0 ...ics-apm.service_summary.10m-fallback@lifecycle.yaml | 0 ...rics-apm.service_summary.1m-fallback@lifecycle.yaml | 0 ...ics-apm.service_summary.60m-fallback@lifecycle.yaml | 0 ...apm.service_transaction.10m-fallback@lifecycle.yaml | 0 ...-apm.service_transaction.1m-fallback@lifecycle.yaml | 0 ...apm.service_transaction.60m-fallback@lifecycle.yaml | 0 ...metrics-apm.transaction.10m-fallback@lifecycle.yaml | 0 .../metrics-apm.transaction.1m-fallback@lifecycle.yaml | 0 ...metrics-apm.transaction.60m-fallback@lifecycle.yaml | 0 .../traces-apm-fallback@lifecycle.yaml | 0 .../traces-apm.rum-fallback@lifecycle.yaml | 0 .../traces-apm.sampled-fallback@lifecycle.yaml | 0 21 files changed, 10 insertions(+), 4 deletions(-) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/logs-apm.app-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/logs-apm.error-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.app-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.internal-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/traces-apm-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/traces-apm.rum-fallback@lifecycle.yaml (100%) rename x-pack/plugin/{apm-data/src/main/resources => core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata}/component-templates/traces-apm.sampled-fallback@lifecycle.yaml (100%) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/ResourceUtils.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/ResourceUtils.java index 9840535989a7c..4732618ce0b98 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/ResourceUtils.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/ResourceUtils.java @@ -7,12 +7,15 @@ package org.elasticsearch.xpack.core.template; +import org.elasticsearch.xpack.core.template.resources.TemplateResources; + import java.io.IOException; import java.io.InputStream; import java.nio.charset.StandardCharsets; import java.util.Map; public class ResourceUtils { + static byte[] loadVersionedResourceUTF8(Class clazz, String name, int version, String versionProperty) { return loadVersionedResourceUTF8(clazz, name, version, versionProperty, Map.of()); } @@ -25,7 +28,7 @@ static byte[] loadVersionedResourceUTF8( Map variables ) { try { - String content = loadResource(clazz, name); + String content = loadResourceWithFallback(clazz, name); content = TemplateUtils.replaceVariables(content, String.valueOf(version), versionProperty, variables); return content.getBytes(StandardCharsets.UTF_8); } catch (IOException e) { @@ -33,8 +36,11 @@ static byte[] loadVersionedResourceUTF8( } } - public static String loadResource(Class clazz, String name) throws IOException { + static String loadResourceWithFallback(Class clazz, String name) throws IOException { InputStream is = clazz.getResourceAsStream(name); + if (is == null) { + is = TemplateResources.class.getResourceAsStream("/"+clazz.getPackageName()+name); + } if (is == null) { throw new IOException("Resource [" + name + "] not found in classpath."); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/YamlTemplateRegistry.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/YamlTemplateRegistry.java index a4e5d7cdc4b44..596917aa1b95c 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/YamlTemplateRegistry.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/template/YamlTemplateRegistry.java @@ -31,7 +31,7 @@ import java.util.Optional; import java.util.stream.Collectors; -import static org.elasticsearch.xpack.core.template.ResourceUtils.loadResource; +import static org.elasticsearch.xpack.core.template.ResourceUtils.loadResourceWithFallback; import static org.elasticsearch.xpack.core.template.ResourceUtils.loadVersionedResourceUTF8; /** @@ -64,7 +64,7 @@ public YamlTemplateRegistry( try { final Map resources = XContentHelper.convertToMap( YamlXContent.yamlXContent, - loadResource(this.getClass(), "/resources.yaml"), + loadResourceWithFallback(this.getClass(), "/resources.yaml"), false ); version = (((Number) resources.get("version")).intValue()); diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/logs-apm.app-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.app-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/logs-apm.app-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/logs-apm.error-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/logs-apm.error-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/logs-apm.error-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.app-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.app-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.app-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.internal-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.internal-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.internal-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.10m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.1m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_destination.60m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.10m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.1m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_summary.60m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.10m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.1m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.service_transaction.60m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.10m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.1m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/metrics-apm.transaction.60m-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm.rum-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.rum-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm.rum-fallback@lifecycle.yaml diff --git a/x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml b/x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm.sampled-fallback@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm-data/src/main/resources/component-templates/traces-apm.sampled-fallback@lifecycle.yaml rename to x-pack/plugin/core/template-resources/src/main/resources/org.elasticsearch.xpack.apmdata/component-templates/traces-apm.sampled-fallback@lifecycle.yaml