From 6ae7d18a551a9d2bc60f00ba11452a195767af49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joel=20H=C3=B6ner?= Date: Mon, 12 Feb 2024 11:09:14 +0100 Subject: [PATCH] [Profiling] add `service.name` field to event index template (#105356) --- .../profiling/component-template/profiling-events.json | 3 +++ .../xpack/profiling/ProfilingIndexTemplateRegistry.java | 5 +++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-events.json b/x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-events.json index d8a27813734e4..8e1b8478d90ba 100644 --- a/x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-events.json +++ b/x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-events.json @@ -76,6 +76,9 @@ }, "tags": { "type": "keyword" + }, + "service.name": { + "type": "keyword" } } } diff --git a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/ProfilingIndexTemplateRegistry.java b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/ProfilingIndexTemplateRegistry.java index ce15982450a66..1762b2537c455 100644 --- a/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/ProfilingIndexTemplateRegistry.java +++ b/x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/ProfilingIndexTemplateRegistry.java @@ -44,10 +44,11 @@ public class ProfilingIndexTemplateRegistry extends IndexTemplateRegistry { // version 1: initial // version 2: Added 'profiling.host.machine' keyword mapping to profiling-hosts // version 3: Add optional component template 'profiling-ilm@custom' to all ILM-managed index templates - public static final int INDEX_TEMPLATE_VERSION = 3; + // version 4: Added 'service.name' keyword mapping to profiling-events + public static final int INDEX_TEMPLATE_VERSION = 4; // history for individual indices / index templates. Only bump these for breaking changes that require to create a new index - public static final int PROFILING_EVENTS_VERSION = 1; + public static final int PROFILING_EVENTS_VERSION = 2; public static final int PROFILING_EXECUTABLES_VERSION = 1; public static final int PROFILING_METRICS_VERSION = 1; public static final int PROFILING_HOSTS_VERSION = 1;