From db19f78304aaf0f259d4c96abc098b920a19dbdb Mon Sep 17 00:00:00 2001 From: Andrew Wilkins Date: Wed, 13 Sep 2023 13:30:57 +0800 Subject: [PATCH] Adjust template and pipeline names to convention See https://github.com/elastic/elasticsearch/issues/96267#issuecomment-1662129512 - Index templates have a "@template" suffix - Component templates are split into settings and mappings, and have a @settings and @mappings suffix respectively - Ingest pipelines generally have a @pipeline suffix, except for one special case where we use @default-pipeline We no longer have a component template for every data stream, rather we have reusable component templates where it makes sense. For example, we now have metrics-apm@settings and metrics-apm@mappings, which are included by all APM metrics data streams. We now set both default_pipeline and final_pipeline in the index templates, preventing users from overriding them completely. The default pipeline is always apm@default-pipeline, which performs some rerouting of legacy data, and invokes user-defined @custom pipelines based on the data_stream.type and data_stream.dataset fields. The final pipeline just performs built-in processing. --- .../test/rest/ESRestTestCase.java | 2 +- ...ention-10d.yaml => apm-10d@lifecycle.yaml} | 0 ...tion-180d.yaml => apm-180d@lifecycle.yaml} | 0 ...tion-390d.yaml => apm-390d@lifecycle.yaml} | 0 ...ention-90d.yaml => apm-90d@lifecycle.yaml} | 0 .../{apm.yaml => apm@mappings.yaml} | 6 -- .../component-templates/apm@settings.yaml | 7 ++ ...rror.yaml => logs-apm.error@mappings.yaml} | 3 - .../metrics-apm.internal.yaml | 17 ---- ...ics-apm.service_destination@mappings.yaml} | 9 -- ...metrics-apm.service_summary@mappings.yaml} | 9 -- ...ics-apm.service_transaction@mappings.yaml} | 9 -- ... => metrics-apm.transaction@mappings.yaml} | 9 -- ...apm.app.yaml => metrics-apm@mappings.yaml} | 4 - .../metrics-apm@settings.yaml | 5 ++ ....rum.yaml => traces-apm.rum@mappings.yaml} | 3 - ...aces-apm.yaml => traces-apm@mappings.yaml} | 9 -- .../main/resources/index-templates/README.md | 7 ++ ...pm.app.yaml => logs-apm.app@template.yaml} | 18 ++-- ...rror.yaml => logs-apm.error@template.yaml} | 25 ++++-- ...app.yaml => metrics-apm.app@template.yaml} | 21 +++-- ...aml => metrics-apm.internal@template.yaml} | 26 ++++-- ...apm.service_destination.10m@template.yaml} | 22 +++-- ...-apm.service_destination.1m@template.yaml} | 22 +++-- ...apm.service_destination.60m@template.yaml} | 22 +++-- ...ics-apm.service_summary.10m@template.yaml} | 22 +++-- ...rics-apm.service_summary.1m@template.yaml} | 22 +++-- ...ics-apm.service_summary.60m@template.yaml} | 22 +++-- ...apm.service_transaction.10m@template.yaml} | 22 +++-- ...-apm.service_transaction.1m@template.yaml} | 22 +++-- ...apm.service_transaction.60m@template.yaml} | 22 +++-- ...metrics-apm.transaction.10m@template.yaml} | 22 +++-- ... metrics-apm.transaction.1m@template.yaml} | 22 +++-- ...metrics-apm.transaction.60m@template.yaml} | 22 +++-- .../index-templates/traces-apm.rum.yaml | 22 ----- .../traces-apm.rum@template.yaml | 36 ++++++++ .../index-templates/traces-apm.sampled.yaml | 18 ---- .../traces-apm.sampled@template.yaml} | 17 +++- .../resources/index-templates/traces-apm.yaml | 19 ---- .../index-templates/traces-apm@template.yaml | 33 +++++++ .../apm@default-pipeline.yaml | 45 ++++++++++ .../{apm.yaml => apm@pipeline.yaml} | 0 .../metrics-apm.internal.yaml | 22 ----- ...ics-apm.yaml => metrics-apm@pipeline.yaml} | 2 +- ...aces-apm.yaml => traces-apm@pipeline.yaml} | 2 +- .../apm/src/main/resources/resources.yaml | 87 ++++++++++--------- .../resources/rest-api-spec/test/10_apm.yml | 38 ++++---- 47 files changed, 457 insertions(+), 337 deletions(-) rename x-pack/plugin/apm/src/main/resources/component-templates/{apm-retention-10d.yaml => apm-10d@lifecycle.yaml} (100%) rename x-pack/plugin/apm/src/main/resources/component-templates/{apm-retention-180d.yaml => apm-180d@lifecycle.yaml} (100%) rename x-pack/plugin/apm/src/main/resources/component-templates/{apm-retention-390d.yaml => apm-390d@lifecycle.yaml} (100%) rename x-pack/plugin/apm/src/main/resources/component-templates/{apm-retention-90d.yaml => apm-90d@lifecycle.yaml} (100%) rename x-pack/plugin/apm/src/main/resources/component-templates/{apm.yaml => apm@mappings.yaml} (79%) create mode 100644 x-pack/plugin/apm/src/main/resources/component-templates/apm@settings.yaml rename x-pack/plugin/apm/src/main/resources/component-templates/{logs-apm.error.yaml => logs-apm.error@mappings.yaml} (89%) delete mode 100644 x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.internal.yaml rename x-pack/plugin/apm/src/main/resources/component-templates/{metrics-apm.service_destination.yaml => metrics-apm.service_destination@mappings.yaml} (73%) rename x-pack/plugin/apm/src/main/resources/component-templates/{metrics-apm.service_summary.yaml => metrics-apm.service_summary@mappings.yaml} (73%) rename x-pack/plugin/apm/src/main/resources/component-templates/{metrics-apm.service_transaction.yaml => metrics-apm.service_transaction@mappings.yaml} (73%) rename x-pack/plugin/apm/src/main/resources/component-templates/{metrics-apm.transaction.yaml => metrics-apm.transaction@mappings.yaml} (73%) rename x-pack/plugin/apm/src/main/resources/component-templates/{metrics-apm.app.yaml => metrics-apm@mappings.yaml} (68%) create mode 100644 x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@settings.yaml rename x-pack/plugin/apm/src/main/resources/component-templates/{traces-apm.rum.yaml => traces-apm.rum@mappings.yaml} (88%) rename x-pack/plugin/apm/src/main/resources/component-templates/{traces-apm.yaml => traces-apm@mappings.yaml} (77%) create mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/README.md rename x-pack/plugin/apm/src/main/resources/index-templates/{logs-apm.app.yaml => logs-apm.app@template.yaml} (69%) rename x-pack/plugin/apm/src/main/resources/index-templates/{logs-apm.error.yaml => logs-apm.error@template.yaml} (55%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.app.yaml => metrics-apm.app@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.internal.yaml => metrics-apm.internal@template.yaml} (54%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_destination.10m.yaml => metrics-apm.service_destination.10m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_destination.1m.yaml => metrics-apm.service_destination.1m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_destination.60m.yaml => metrics-apm.service_destination.60m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_summary.10m.yaml => metrics-apm.service_summary.10m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_summary.1m.yaml => metrics-apm.service_summary.1m@template.yaml} (62%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_summary.60m.yaml => metrics-apm.service_summary.60m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_transaction.10m.yaml => metrics-apm.service_transaction.10m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_transaction.1m.yaml => metrics-apm.service_transaction.1m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.service_transaction.60m.yaml => metrics-apm.service_transaction.60m@template.yaml} (63%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.transaction.10m.yaml => metrics-apm.transaction.10m@template.yaml} (62%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.transaction.1m.yaml => metrics-apm.transaction.1m@template.yaml} (62%) rename x-pack/plugin/apm/src/main/resources/index-templates/{metrics-apm.transaction.60m.yaml => metrics-apm.transaction.60m@template.yaml} (62%) delete mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum.yaml create mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum@template.yaml delete mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled.yaml rename x-pack/plugin/apm/src/main/resources/{component-templates/traces-apm.sampled.yaml => index-templates/traces-apm.sampled@template.yaml} (57%) delete mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.yaml create mode 100644 x-pack/plugin/apm/src/main/resources/index-templates/traces-apm@template.yaml create mode 100644 x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@default-pipeline.yaml rename x-pack/plugin/apm/src/main/resources/ingest-pipelines/{apm.yaml => apm@pipeline.yaml} (100%) delete mode 100644 x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.internal.yaml rename x-pack/plugin/apm/src/main/resources/ingest-pipelines/{metrics-apm.yaml => metrics-apm@pipeline.yaml} (98%) rename x-pack/plugin/apm/src/main/resources/ingest-pipelines/{traces-apm.yaml => traces-apm@pipeline.yaml} (98%) diff --git a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java index b6fdd706f9c7a..a506d7ffac4d6 100644 --- a/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java +++ b/test/framework/src/main/java/org/elasticsearch/test/rest/ESRestTestCase.java @@ -1851,7 +1851,7 @@ protected static boolean isXPackTemplate(String name) { if (name.startsWith("elastic-connectors")) { return true; } - if (name.equals("apm") + if (name.startsWith("apm@") || name.startsWith("apm-") || name.startsWith("traces-apm") || name.startsWith("metrics-apm") diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-10d.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm-10d@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-10d.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/apm-10d@lifecycle.yaml diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-180d.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm-180d@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-180d.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/apm-180d@lifecycle.yaml diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-390d.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm-390d@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-390d.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/apm-390d@lifecycle.yaml diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-90d.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm-90d@lifecycle.yaml similarity index 100% rename from x-pack/plugin/apm/src/main/resources/component-templates/apm-retention-90d.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/apm-90d@lifecycle.yaml diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm@mappings.yaml similarity index 79% rename from x-pack/plugin/apm/src/main/resources/component-templates/apm.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/apm@mappings.yaml index 548e82fdc4a66..a761c1b3fdb95 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/apm.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/apm@mappings.yaml @@ -1,11 +1,5 @@ version: ${xpack.apm.template.version} template: - settings: - index: - default_pipeline: apm - sort: - field: "@timestamp" - order: desc mappings: dynamic: true dynamic_templates: diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/apm@settings.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/apm@settings.yaml new file mode 100644 index 0000000000000..1fa31c19580df --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/component-templates/apm@settings.yaml @@ -0,0 +1,7 @@ +version: ${xpack.apm.template.version} +template: + settings: + index: + sort: + field: "@timestamp" + order: desc diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error@mappings.yaml similarity index 89% rename from x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error@mappings.yaml index a3c273ce34681..ee4c51c1be3d1 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/logs-apm.error@mappings.yaml @@ -3,9 +3,6 @@ version: ${xpack.apm.template.version} template: mappings: properties: - processor.event: - type: constant_keyword - value: error error.custom: type: flattened error.exception.attributes: diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.internal.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.internal.yaml deleted file mode 100644 index dbf63b77df270..0000000000000 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.internal.yaml +++ /dev/null @@ -1,17 +0,0 @@ ---- -version: ${xpack.apm.template.version} -template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm.internal - mappings: - _source: - mode: synthetic - properties: - data_stream.dataset: - type: constant_keyword - value: apm.internal - processor.event: - type: constant_keyword - value: metric diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination@mappings.yaml similarity index 73% rename from x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination@mappings.yaml index c6f11f270a81c..fa63316b92384 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_destination@mappings.yaml @@ -1,17 +1,8 @@ --- version: ${xpack.apm.template.version} template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm mappings: - _source: - mode: synthetic properties: - processor.event: - type: constant_keyword - value: metric metricset.name: type: constant_keyword value: service_destination diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary@mappings.yaml similarity index 73% rename from x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary@mappings.yaml index 9329a5acbd0c5..fc20b2c4c9e5d 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_summary@mappings.yaml @@ -1,17 +1,8 @@ --- version: ${xpack.apm.template.version} template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm mappings: - _source: - mode: synthetic properties: - processor.event: - type: constant_keyword - value: metric metricset.name: type: constant_keyword value: service_summary diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction@mappings.yaml similarity index 73% rename from x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction@mappings.yaml index a5504c5418599..bb57e9b189b5e 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.service_transaction@mappings.yaml @@ -1,16 +1,7 @@ version: ${xpack.apm.template.version} template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm mappings: - _source: - mode: synthetic properties: - processor.event: - type: constant_keyword - value: metric metricset.name: type: constant_keyword value: service_transaction diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction@mappings.yaml similarity index 73% rename from x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction@mappings.yaml index f84cde94dba20..b3204f8ced607 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.transaction@mappings.yaml @@ -1,16 +1,7 @@ version: ${xpack.apm.template.version} template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm mappings: - _source: - mode: synthetic properties: - processor.event: - type: constant_keyword - value: metric metricset.name: type: constant_keyword value: transaction diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.app.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@mappings.yaml similarity index 68% rename from x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.app.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@mappings.yaml index 5cf766c1abd7b..abe71ef8f7c1d 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm.app.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@mappings.yaml @@ -1,10 +1,6 @@ --- version: ${xpack.apm.template.version} template: - settings: - codec: best_compression - index: - default_pipeline: metrics-apm mappings: _source: mode: synthetic diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@settings.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@settings.yaml new file mode 100644 index 0000000000000..915796a4f2a6f --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/component-templates/metrics-apm@settings.yaml @@ -0,0 +1,5 @@ +--- +version: ${xpack.apm.template.version} +template: + settings: + codec: best_compression diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum@mappings.yaml similarity index 88% rename from x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum@mappings.yaml index a1cb2a1889029..0140dc3ca9bbb 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.rum@mappings.yaml @@ -3,9 +3,6 @@ version: ${xpack.apm.template.version} template: mappings: properties: - data_stream.dataset: - type: constant_keyword - value: apm.rum transaction.experience.cls: type: scaled_float scaling_factor: 1000 diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.yaml b/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm@mappings.yaml similarity index 77% rename from x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.yaml rename to x-pack/plugin/apm/src/main/resources/component-templates/traces-apm@mappings.yaml index 4585749d716fa..29369d972baeb 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.yaml +++ b/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm@mappings.yaml @@ -1,19 +1,10 @@ --- version: ${xpack.apm.template.version} template: - settings: - index: - default_pipeline: traces-apm mappings: properties: processor.event: type: keyword - data_stream.type: - type: constant_keyword - value: traces - data_stream.dataset: - type: constant_keyword - value: apm event.success_count: type: byte index: false diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/README.md b/x-pack/plugin/apm/src/main/resources/index-templates/README.md new file mode 100644 index 0000000000000..99f4f4218ca90 --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/index-templates/README.md @@ -0,0 +1,7 @@ +Mappings and settings that must not be overridden are to be defined +in the index templates, as these will take precedence over component +template mappings and settings. This includes: + + - `index.default_pipeline` + - `index.final_pipeline` + - values for `data_stream.*` diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app@template.yaml similarity index 69% rename from x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app@template.yaml index 5a62ad8c8efe9..d454ab2ca9141 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.app@template.yaml @@ -2,17 +2,23 @@ version: ${xpack.apm.template.version} index_patterns: ["logs-apm.app.*-*"] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for logs-apm.app.*-* + managed: true composed_of: - logs-mappings -- apm -- apm-retention-10d +- apm@mappings +- apm@settings +- apm-10d@lifecycle - apm@custom - logs-apm.app@custom - ecs@dynamic_templates ignore_missing_component_templates: - logs-apm.app@custom - apm@custom -allow_auto_create: true -_meta: - description: Index template for logs-apm.app.*-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error@template.yaml similarity index 55% rename from x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error@template.yaml index 235530e90659b..e0ac674ea271d 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/logs-apm.error@template.yaml @@ -3,18 +3,29 @@ version: ${xpack.apm.template.version} index_patterns: ["logs-apm.error-*"] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for logs-apm.error-* + managed: true composed_of: - logs-mappings -- apm -- apm-retention-10d -- logs-apm.error +- apm@mappings +- apm@settings +- apm-10d@lifecycle +- logs-apm.error@mappings - apm@custom - logs-apm.error@custom - ecs@dynamic_templates ignore_missing_component_templates: - logs-apm.error@custom - apm@custom -allow_auto_create: true -_meta: - description: Index template for logs-apm.error-* - managed: true +template: + mappings: + properties: + processor.event: + type: constant_keyword + value: error + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app@template.yaml index b18fdf7d92cc9..8b8a47c409a88 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.app@template.yaml @@ -2,18 +2,25 @@ version: ${xpack.apm.template.version} index_patterns: ["metrics-apm.app.*-*"] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: "Index template for metrics-apm.app.*-*" + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.app +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings - apm@custom - metrics-apm.app@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.app@custom -allow_auto_create: true -_meta: - description: "Index template for metrics-apm.app.*-*" - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal@template.yaml similarity index 54% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal@template.yaml index 70255257e8038..daf309af378f6 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.internal@template.yaml @@ -3,18 +3,30 @@ version: ${xpack.apm.template.version} index_patterns: ["metrics-apm.internal-*"] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: "Index template for metrics-apm.internal-*" + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.internal +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings - apm@custom - metrics-apm.internal@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.internal@custom -allow_auto_create: true -_meta: - description: "Index template for metrics-apm.internal-*" - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline + mappings: + properties: + data_stream.dataset: + type: constant_keyword + value: apm.internal diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml index cc6450cd8f736..0617fea08d87b 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.10m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_destination.10m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_destination.10m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-180d -- metrics-apm.service_destination +- apm@mappings +- apm@settings +- apm-180d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_destination@mappings - apm@custom - metrics-apm.service_destination@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_destination@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_destination.10m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml index 2fd7a4bba8602..fa8961019ca75 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.1m@template.yaml @@ -3,18 +3,26 @@ version: ${xpack.apm.template.version} index_patterns: [metrics-apm.service_destination.1m-*] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_destination.1m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.service_destination +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_destination@mappings - apm@custom - metrics-apm.service_destination@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_destination@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_destination.1m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml index abe157e024cac..2e834b5ec3ffa 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_destination.60m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_destination.60m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_destination.60m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-390d -- metrics-apm.service_destination +- apm@mappings +- apm@settings +- apm-390d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_destination@mappings - apm@custom - metrics-apm.service_destination@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_destination@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_destination.60m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml index 0971fc2a5487c..6f16370cd2617 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.10m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_summary.10m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_summary.10m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-180d -- metrics-apm.service_summary +- apm@mappings +- apm@settings +- apm-180d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_summary@mappings - apm@custom - metrics-apm.service_summary@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_summary@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_summary.10m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml similarity index 62% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml index 26995f71bb337..bd876c1b80d96 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.1m@template.yaml @@ -3,18 +3,26 @@ version: ${xpack.apm.template.version} index_patterns: [metrics-apm.service_summary.1m-*] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_summary.1m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.service_summary +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_summary@mappings - apm@custom - metrics-apm.service_summary@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_summary@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_summary.1m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml index 81e9cdd0e77ff..591f547c5039d 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_summary.60m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_summary.60m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_summary.60m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-390d -- metrics-apm.service_summary +- apm@mappings +- apm@settings +- apm-390d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_summary@mappings - apm@custom - metrics-apm.service_summary@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_summary@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_summary.60m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml index 98002bf529a3b..92264a670eca2 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.10m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_transaction.10m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_transaction.10m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-180d -- metrics-apm.service_transaction +- apm@mappings +- apm@settings +- apm-180d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_transaction@mappings - apm@custom - metrics-apm.service_transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_transaction.10m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml index fd00f796434e8..ea1f115dd8f97 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.1m@template.yaml @@ -3,18 +3,26 @@ version: ${xpack.apm.template.version} index_patterns: [metrics-apm.service_transaction.1m-*] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_transaction.1m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.service_transaction +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_transaction@mappings - apm@custom - metrics-apm.service_transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_transaction.1m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml similarity index 63% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml index 9304e8530666d..4d10a34561e5d 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.service_transaction.60m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.service_transaction.60m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.service_transaction.60m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-390d -- metrics-apm.service_transaction +- apm@mappings +- apm@settings +- apm-390d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.service_transaction@mappings - apm@custom - metrics-apm.service_transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.service_transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.service_transaction.60m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml similarity index 62% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml index db433bc02e4fd..f34f956f9ce25 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.10m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.transaction.10m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.transaction.10m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-180d -- metrics-apm.transaction +- apm@mappings +- apm@settings +- apm-180d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.transaction@mappings - apm@custom - metrics-apm.transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.transaction.10m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml similarity index 62% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml index 3294c91740ea4..d98ee8d705d7a 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.1m@template.yaml @@ -3,18 +3,26 @@ version: ${xpack.apm.template.version} index_patterns: [metrics-apm.transaction.1m-*] priority: 150 data_stream: {} +allow_auto_create: true +_meta: + description: Index template for metrics-apm.transaction.1m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-90d -- metrics-apm.transaction +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.transaction@mappings - apm@custom - metrics-apm.transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.transaction.1m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml similarity index 62% rename from x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml index b77afe5495149..bdd0310f1041c 100644 --- a/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/metrics-apm.transaction.60m@template.yaml @@ -4,18 +4,26 @@ index_patterns: [metrics-apm.transaction.60m-*] priority: 150 data_stream: hidden: true +allow_auto_create: true +_meta: + description: Index template for metrics-apm.transaction.60m-* + managed: true composed_of: - metrics-mappings -- apm -- apm-retention-390d -- metrics-apm.transaction +- apm@mappings +- apm@settings +- apm-390d@lifecycle +- metrics-apm@mappings +- metrics-apm@settings +- metrics-apm.transaction@mappings - apm@custom - metrics-apm.transaction@custom - ecs@dynamic_templates ignore_missing_component_templates: - apm@custom - metrics-apm.transaction@custom -allow_auto_create: true -_meta: - description: Index template for metrics-apm.transaction.60m-* - managed: true +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: metrics-apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum.yaml deleted file mode 100644 index 2382646069c99..0000000000000 --- a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -version: ${xpack.apm.template.version} -index_patterns: ["traces-apm.rum-*"] -priority: 150 -data_stream: {} -composed_of: -- apm -- apm-retention-90d -- traces-apm -- traces-apm.rum -- apm@custom -- traces-apm@custom -- traces-apm.rum@custom -- ecs@dynamic_templates -ignore_missing_component_templates: -- traces-apm.rum@custom -- traces-apm@custom -- apm@custom -allow_auto_create: true -_meta: - description: Index template for traces-apm.rum-* - managed: true diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum@template.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum@template.yaml new file mode 100644 index 0000000000000..034d054fadc24 --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.rum@template.yaml @@ -0,0 +1,36 @@ +--- +version: ${xpack.apm.template.version} +index_patterns: ["traces-apm.rum-*"] +priority: 150 +data_stream: {} +allow_auto_create: true +_meta: + description: Index template for traces-apm.rum-* + managed: true +composed_of: +- apm@mappings +- apm@settings +- apm-90d@lifecycle +- traces-apm@mappings +- traces-apm.rum@mappings +- apm@custom +- traces-apm@custom +- traces-apm.rum@custom +- ecs@dynamic_templates +ignore_missing_component_templates: +- traces-apm.rum@custom +- traces-apm@custom +- apm@custom +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: traces-apm@pipeline + mappings: + properties: + data_stream.type: + type: constant_keyword + value: traces + data_stream.dataset: + type: constant_keyword + value: apm.rum diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled.yaml deleted file mode 100644 index 7450f5ed322f2..0000000000000 --- a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled.yaml +++ /dev/null @@ -1,18 +0,0 @@ ---- -version: ${xpack.apm.template.version} -index_patterns: ["traces-apm.sampled-*"] -priority: 150 -data_stream: {} -composed_of: -- apm -- traces-apm.sampled -- apm@custom -- traces-apm.sampled@custom -- ecs@dynamic_templates -ignore_missing_component_templates: -- traces-apm.sampled@custom -- apm@custom -allow_auto_create: true -_meta: - description: Index template for traces-apm.sampled-* - managed: true diff --git a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.sampled.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled@template.yaml similarity index 57% rename from x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.sampled.yaml rename to x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled@template.yaml index 9ef795acec29a..462b73e7b0a32 100644 --- a/x-pack/plugin/apm/src/main/resources/component-templates/traces-apm.sampled.yaml +++ b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.sampled@template.yaml @@ -1,9 +1,20 @@ --- version: ${xpack.apm.template.version} +index_patterns: ["traces-apm.sampled-*"] +priority: 150 +data_stream: {} +allow_auto_create: true +_meta: + description: Index template for traces-apm.sampled-* + managed: true +composed_of: +- apm@mappings +- apm@settings +- apm@custom +- ecs@dynamic_templates +ignore_missing_component_templates: +- apm@custom template: - settings: - index: - default_pipeline: apm lifecycle: data_retention: 1h mappings: diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.yaml deleted file mode 100644 index 9987a8ea4f1d7..0000000000000 --- a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm.yaml +++ /dev/null @@ -1,19 +0,0 @@ ---- -version: ${xpack.apm.template.version} -index_patterns: ["traces-apm-*"] -priority: 150 -data_stream: {} -composed_of: -- apm -- apm-retention-10d -- traces-apm -- apm@custom -- traces-apm@custom -- ecs@dynamic_templates -ignore_missing_component_templates: -- traces-apm@custom -- apm@custom -allow_auto_create: true -_meta: - description: Index template for traces-apm-* - managed: true diff --git a/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm@template.yaml b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm@template.yaml new file mode 100644 index 0000000000000..f6a6a572aed02 --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/index-templates/traces-apm@template.yaml @@ -0,0 +1,33 @@ +--- +version: ${xpack.apm.template.version} +index_patterns: ["traces-apm-*"] +priority: 150 +data_stream: {} +allow_auto_create: true +_meta: + description: Index template for traces-apm-* + managed: true +composed_of: +- apm@mappings +- apm@settings +- apm-10d@lifecycle +- traces-apm@mappings +- apm@custom +- traces-apm@custom +- ecs@dynamic_templates +ignore_missing_component_templates: +- traces-apm@custom +- apm@custom +template: + settings: + index: + default_pipeline: apm@default-pipeline + final_pipeline: traces-apm@pipeline + mappings: + properties: + data_stream.type: + type: constant_keyword + value: traces + data_stream.dataset: + type: constant_keyword + value: apm diff --git a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@default-pipeline.yaml b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@default-pipeline.yaml new file mode 100644 index 0000000000000..1e07e1be9e197 --- /dev/null +++ b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@default-pipeline.yaml @@ -0,0 +1,45 @@ +--- +version: ${xpack.apm.template.version} +_meta: + managed: true +description: | + Built-in default ingest pipeline for all APM data streams. + + This pipeline exists purely for routing, which cannot be + performed in a final pipeline, and for invoking user-defined + custom pipelines. All built-in processing occurs in the final + pipelines. +processors: + # Older versions of apm-server write various metrics to the + # metrics-apm.internal data stream, which newer versions break + # into separate datasets. We reroute these metrics coming from + # older versions of apm-server based on 'metricset.name'. +- set: + if: | + (ctx.data_stream?.dataset == 'apm.internal' || ctx['data_stream.dataset'] == 'apm.internal') && + (ctx.metricset?.name == 'transaction' || ctx.metricset?.name == 'service_destination') + field: metricset.interval + value: 1m + override: false +- reroute: + if: | + (ctx.data_stream?.dataset == 'apm.internal' || ctx['data_stream.dataset'] == 'apm.internal') && + (ctx.metricset?.name == 'transaction') + dataset: apm.transaction.1m +- reroute: + if: | + (ctx.data_stream?.dataset == 'apm.internal' || ctx['data_stream.dataset'] == 'apm.internal') && + (ctx.metricset?.name == 'service_destination') + dataset: apm.service_destination.1m + +# Invoke user-defined custom pipelines, in ascending order +# of specificity. +- pipeline: + name: apm@custom + ignore_missing_pipeline: true +- pipeline: + name: "{{{data_stream.type}}}-apm@custom" + ignore_missing_pipeline: true +- pipeline: + name: "{{{data_stream.type}}}-{{{data_stream.dataset}}}@custom" + ignore_missing_pipeline: true diff --git a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm.yaml b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@pipeline.yaml similarity index 100% rename from x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm.yaml rename to x-pack/plugin/apm/src/main/resources/ingest-pipelines/apm@pipeline.yaml diff --git a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.internal.yaml b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.internal.yaml deleted file mode 100644 index 43f0e71e8efd6..0000000000000 --- a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.internal.yaml +++ /dev/null @@ -1,22 +0,0 @@ ---- -version: ${xpack.apm.template.version} -description: | - Built-in ingest pipeline for metrics-apm.internal-* data streams -_meta: - managed: true -processors: - # Older versions of apm-server write various metrics to this data stream, - # while newer versions break them into separate datasets. Reroute based - # on the 'metricset.name' field. -- set: - if: "ctx.metricset?.name == 'transaction' || ctx.metricset?.name == 'service_destination'" - field: metricset.interval - value: 1m -- reroute: - if: "ctx.metricset?.name == 'transaction'" - dataset: apm.transaction.1m -- reroute: - if: "ctx.metricset?.name == 'service_destination'" - dataset: apm.service_destination.1m -- pipeline: - name: metrics-apm diff --git a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.yaml b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm@pipeline.yaml similarity index 98% rename from x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.yaml rename to x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm@pipeline.yaml index bcb9d541171fc..63607616af3ac 100644 --- a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm.yaml +++ b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/metrics-apm@pipeline.yaml @@ -47,4 +47,4 @@ processors: ctx._dynamic_templates = dynamic_templates; ctx.metricset.remove("samples"); - pipeline: - name: apm + name: apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm.yaml b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm@pipeline.yaml similarity index 98% rename from x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm.yaml rename to x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm@pipeline.yaml index fa5ad8e0bd2ac..262a3d8f59e2e 100644 --- a/x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm.yaml +++ b/x-pack/plugin/apm/src/main/resources/ingest-pipelines/traces-apm@pipeline.yaml @@ -39,4 +39,4 @@ processors: field: event.success_count value: 0 - pipeline: - name: apm + name: apm@pipeline diff --git a/x-pack/plugin/apm/src/main/resources/resources.yaml b/x-pack/plugin/apm/src/main/resources/resources.yaml index 84692a3a5d14a..9f2ccb0e2bf67 100644 --- a/x-pack/plugin/apm/src/main/resources/resources.yaml +++ b/x-pack/plugin/apm/src/main/resources/resources.yaml @@ -4,52 +4,55 @@ version: 1 component-templates: - - apm - - apm-retention-10d - - apm-retention-90d - - apm-retention-180d - - apm-retention-390d - - logs-apm.error - - metrics-apm.app - - metrics-apm.internal - - metrics-apm.service_destination - - metrics-apm.service_summary - - metrics-apm.service_transaction - - metrics-apm.transaction - - traces-apm - - traces-apm.rum - - traces-apm.sampled + # Data lifecycle. + - apm-10d@lifecycle + - apm-90d@lifecycle + - apm-180d@lifecycle + - apm-390d@lifecycle + # Common mappings and settings. + # - *-apm* data streams compose apm@* + # - metrics-apm* data streams additionally compose metrics-apm@* + - apm@mappings + - apm@settings + - metrics-apm@mappings + - metrics-apm@settings + # Data stream-specific mappings. + - logs-apm.error@mappings + - metrics-apm.service_destination@mappings + - metrics-apm.service_summary@mappings + - metrics-apm.service_transaction@mappings + - metrics-apm.transaction@mappings + - traces-apm@mappings + - traces-apm.rum@mappings index-templates: - - logs-apm.app - - logs-apm.error - - metrics-apm.app - - metrics-apm.internal - - metrics-apm.service_destination.1m - - metrics-apm.service_destination.10m - - metrics-apm.service_destination.60m - - metrics-apm.service_summary.1m - - metrics-apm.service_summary.10m - - metrics-apm.service_summary.60m - - metrics-apm.service_transaction.1m - - metrics-apm.service_transaction.10m - - metrics-apm.service_transaction.60m - - metrics-apm.transaction.1m - - metrics-apm.transaction.10m - - metrics-apm.transaction.60m - - traces-apm - - traces-apm.rum - - traces-apm.sampled + - logs-apm.app@template + - logs-apm.error@template + - metrics-apm.app@template + - metrics-apm.internal@template + - metrics-apm.service_destination.1m@template + - metrics-apm.service_destination.10m@template + - metrics-apm.service_destination.60m@template + - metrics-apm.service_summary.1m@template + - metrics-apm.service_summary.10m@template + - metrics-apm.service_summary.60m@template + - metrics-apm.service_transaction.1m@template + - metrics-apm.service_transaction.10m@template + - metrics-apm.service_transaction.60m@template + - metrics-apm.transaction.1m@template + - metrics-apm.transaction.10m@template + - metrics-apm.transaction.60m@template + - traces-apm@template + - traces-apm.rum@template + - traces-apm.sampled@template # Ingest pipeline configuration requires to manually specify pipeline dependencies ingest-pipelines: - - apm: {} - - traces-apm: + - apm@default-pipeline: {} + - apm@pipeline: {} + - traces-apm@pipeline: dependencies: - - apm - - metrics-apm: + - apm@pipeline + - metrics-apm@pipeline: dependencies: - - apm - - metrics-apm.internal: - dependencies: - - metrics-apm + - apm@pipeline diff --git a/x-pack/plugin/apm/src/yamlRestTest/resources/rest-api-spec/test/10_apm.yml b/x-pack/plugin/apm/src/yamlRestTest/resources/rest-api-spec/test/10_apm.yml index 301c8cdfc8f48..0c538c345ebaa 100644 --- a/x-pack/plugin/apm/src/yamlRestTest/resources/rest-api-spec/test/10_apm.yml +++ b/x-pack/plugin/apm/src/yamlRestTest/resources/rest-api-spec/test/10_apm.yml @@ -13,9 +13,9 @@ setup: indices.get_index_template: name: traces-apm* - length: {index_templates: 3} - - contains: {index_templates: {name: traces-apm}} - - contains: {index_templates: {name: traces-apm.rum}} - - contains: {index_templates: {name: traces-apm.sampled}} + - contains: {index_templates: {name: traces-apm@template}} + - contains: {index_templates: {name: traces-apm.rum@template}} + - contains: {index_templates: {name: traces-apm.sampled@template}} --- "Test metrics-apm* template installation": @@ -26,20 +26,20 @@ setup: indices.get_index_template: name: metrics-apm* - length: {index_templates: 14} - - contains: {index_templates: {name: metrics-apm.app}} - - contains: {index_templates: {name: metrics-apm.internal}} - - contains: {index_templates: {name: metrics-apm.service_destination.1m}} - - contains: {index_templates: {name: metrics-apm.service_destination.10m}} - - contains: {index_templates: {name: metrics-apm.service_destination.60m}} - - contains: {index_templates: {name: metrics-apm.service_summary.1m}} - - contains: {index_templates: {name: metrics-apm.service_summary.10m}} - - contains: {index_templates: {name: metrics-apm.service_summary.60m}} - - contains: {index_templates: {name: metrics-apm.service_transaction.1m}} - - contains: {index_templates: {name: metrics-apm.service_transaction.10m}} - - contains: {index_templates: {name: metrics-apm.service_transaction.60m}} - - contains: {index_templates: {name: metrics-apm.transaction.1m}} - - contains: {index_templates: {name: metrics-apm.transaction.10m}} - - contains: {index_templates: {name: metrics-apm.transaction.60m}} + - contains: {index_templates: {name: metrics-apm.app@template}} + - contains: {index_templates: {name: metrics-apm.internal@template}} + - contains: {index_templates: {name: metrics-apm.service_destination.1m@template}} + - contains: {index_templates: {name: metrics-apm.service_destination.10m@template}} + - contains: {index_templates: {name: metrics-apm.service_destination.60m@template}} + - contains: {index_templates: {name: metrics-apm.service_summary.1m@template}} + - contains: {index_templates: {name: metrics-apm.service_summary.10m@template}} + - contains: {index_templates: {name: metrics-apm.service_summary.60m@template}} + - contains: {index_templates: {name: metrics-apm.service_transaction.1m@template}} + - contains: {index_templates: {name: metrics-apm.service_transaction.10m@template}} + - contains: {index_templates: {name: metrics-apm.service_transaction.60m@template}} + - contains: {index_templates: {name: metrics-apm.transaction.1m@template}} + - contains: {index_templates: {name: metrics-apm.transaction.10m@template}} + - contains: {index_templates: {name: metrics-apm.transaction.60m@template}} --- "Test logs-apm* template installation": @@ -50,8 +50,8 @@ setup: indices.get_index_template: name: logs-apm* - length: {index_templates: 2} - - contains: {index_templates: {name: logs-apm.app}} - - contains: {index_templates: {name: logs-apm.error}} + - contains: {index_templates: {name: logs-apm.app@template}} + - contains: {index_templates: {name: logs-apm.error@template}} --- "Test traces-apm-* data stream indexing":