Skip to content

Commit c7ed156

Browse files
authored
Stop using _source.mode attribute in builtin templates (#117448) (#117483)
Use index.source.mode index setting in builtin templates instead of the deprecated _source.mode mapping attribute.
1 parent 606b1f5 commit c7ed156

File tree

10 files changed

+44
-32
lines changed

10 files changed

+44
-32
lines changed

x-pack/plugin/apm-data/src/main/resources/component-templates/[email protected]

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ _meta:
55
managed: true
66
template:
77
mappings:
8-
_source:
9-
mode: synthetic
108
properties:
119
processor.event:
1210
type: constant_keyword

x-pack/plugin/apm-data/src/main/resources/component-templates/[email protected]

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,12 @@ _meta:
55
managed: true
66
template:
77
settings:
8-
codec: best_compression
9-
mapping:
10-
# apm@settings sets `ignore_malformed: true`, but we need
11-
# to disable this for metrics since they use synthetic source,
12-
# and this combination is incompatible with the
13-
# aggregate_metric_double field type.
14-
ignore_malformed: false
8+
index:
9+
codec: best_compression
10+
mapping:
11+
# apm@settings sets `ignore_malformed: true`, but we need
12+
# to disable this for metrics since they use synthetic source,
13+
# and this combination is incompatible with the
14+
# aggregate_metric_double field type.
15+
ignore_malformed: false
16+
source.mode: synthetic

x-pack/plugin/apm-data/src/main/resources/resources.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# "version" holds the version of the templates and ingest pipelines installed
22
# by xpack-plugin apm-data. This must be increased whenever an existing template or
33
# pipeline is changed, in order for it to be updated on Elasticsearch upgrade.
4-
version: 11
4+
version: 12
55

66
component-templates:
77
# Data lifecycle.

x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-events.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,16 @@
1414
"container.name",
1515
"process.thread.name"
1616
]
17+
},
18+
"mapping": {
19+
"source": {
20+
"mode": "synthetic"
21+
}
1722
}
1823
},
1924
"codec": "best_compression"
2025
},
2126
"mappings": {
22-
"_source": {
23-
"mode": "synthetic"
24-
},
2527
"_meta": {
2628
"index-template-version": ${xpack.profiling.template.version},
2729
"index-version": ${xpack.profiling.index.events.version},

x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-executables.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,15 @@
55
"auto_expand_replicas": "0-1",
66
"refresh_interval": "10s",
77
"hidden": true,
8-
"lifecycle.rollover_alias": "profiling-executables"
8+
"lifecycle.rollover_alias": "profiling-executables",
9+
"mapping": {
10+
"source": {
11+
"mode": "synthetic"
12+
}
13+
}
914
}
1015
},
1116
"mappings": {
12-
"_source": {
13-
"mode": "synthetic"
14-
},
1517
"_meta": {
1618
"index-template-version": ${xpack.profiling.template.version},
1719
"index-version": ${xpack.profiling.index.executables.version},

x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-metrics.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,16 @@
1010
"@timestamp",
1111
"host.id"
1212
]
13+
},
14+
"mapping": {
15+
"source": {
16+
"mode": "synthetic"
17+
}
1318
}
1419
},
1520
"codec": "best_compression"
1621
},
1722
"mappings": {
18-
"_source": {
19-
"mode": "synthetic"
20-
},
2123
"_meta": {
2224
"index-template-version": ${xpack.profiling.template.version},
2325
"index-version": ${xpack.profiling.index.metrics.version},

x-pack/plugin/core/template-resources/src/main/resources/profiling/component-template/profiling-stacktraces.json

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,13 +11,15 @@
1111
"field": [
1212
"Stacktrace.frame.ids"
1313
]
14+
},
15+
"mapping": {
16+
"source": {
17+
"mode": "synthetic"
18+
}
1419
}
1520
}
1621
},
1722
"mappings": {
18-
"_source": {
19-
"mode": "synthetic"
20-
},
2123
"_meta": {
2224
"index-template-version": ${xpack.profiling.template.version},
2325
"index-version": ${xpack.profiling.index.stacktraces.version},

x-pack/plugin/core/template-resources/src/main/resources/profiling/index-template/profiling-sq-executables.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
"index": {
88
"auto_expand_replicas": "0-1",
99
"refresh_interval": "10s",
10-
"hidden": true
10+
"hidden": true,
11+
"mapping": {
12+
"source": {
13+
"mode": "synthetic"
14+
}
15+
}
1116
}
1217
},
1318
"mappings": {
14-
"_source": {
15-
"mode": "synthetic"
16-
},
1719
"_meta": {
1820
"index-template-version": ${xpack.profiling.template.version},
1921
"index-version": ${xpack.profiling.index.sq.executables.version},

x-pack/plugin/core/template-resources/src/main/resources/profiling/index-template/profiling-sq-leafframes.json

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,15 @@
77
"index": {
88
"auto_expand_replicas": "0-1",
99
"refresh_interval": "10s",
10-
"hidden": true
10+
"hidden": true,
11+
"mapping": {
12+
"source": {
13+
"mode": "synthetic"
14+
}
15+
}
1116
}
1217
},
1318
"mappings": {
14-
"_source": {
15-
"mode": "synthetic"
16-
},
1719
"_meta": {
1820
"index-template-version": ${xpack.profiling.template.version},
1921
"index-version": ${xpack.profiling.index.sq.leafframes.version},

x-pack/plugin/profiling/src/main/java/org/elasticsearch/xpack/profiling/persistence/ProfilingIndexTemplateRegistry.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public class ProfilingIndexTemplateRegistry extends IndexTemplateRegistry {
5454
// version 11: Added 'profiling.agent.protocol' keyword mapping to profiling-hosts
5555
// version 12: Added 'profiling.agent.env_https_proxy' keyword mapping to profiling-hosts
5656
// version 13: Added 'container.id' keyword mapping to profiling-events
57-
public static final int INDEX_TEMPLATE_VERSION = 13;
57+
public static final int INDEX_TEMPLATE_VERSION = 14;
5858

5959
// history for individual indices / index templates. Only bump these for breaking changes that require to create a new index
6060
public static final int PROFILING_EVENTS_VERSION = 5;

0 commit comments

Comments
 (0)