Skip to content

Commit

Permalink
Stop using _source.mode attribute in builtin templates
Browse files Browse the repository at this point in the history
Use index.source.mode index setting in builtin templates instead of the deprecated _source.mode mapping attribute.
  • Loading branch information
martijnvg committed Nov 25, 2024
1 parent 2f8bb0b commit d5c051d
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ _meta:
managed: true
template:
mappings:
_source:
mode: synthetic
properties:
processor.event:
type: constant_keyword
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ template:
# and this combination is incompatible with the
# aggregate_metric_double field type.
ignore_malformed: false
index.mapping.source.mode: synthetic
2 changes: 1 addition & 1 deletion x-pack/plugin/apm-data/src/main/resources/resources.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# "version" holds the version of the templates and ingest pipelines installed
# by xpack-plugin apm-data. This must be increased whenever an existing template or
# pipeline is changed, in order for it to be updated on Elasticsearch upgrade.
version: 11
version: 12

component-templates:
# Data lifecycle.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,16 @@
"container.name",
"process.thread.name"
]
},
"mapping": {
"source": {
"mode": "synthetic"
}
}
},
"codec": "best_compression"
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.events.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
"auto_expand_replicas": "0-1",
"refresh_interval": "10s",
"hidden": true,
"lifecycle.rollover_alias": "profiling-executables"
"lifecycle.rollover_alias": "profiling-executables",
"mapping": {
"source": {
"mode": "synthetic"
}
}
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.executables.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,16 @@
"@timestamp",
"host.id"
]
},
"mapping": {
"source": {
"mode": "synthetic"
}
}
},
"codec": "best_compression"
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.metrics.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,15 @@
"field": [
"Stacktrace.frame.ids"
]
},
"mapping": {
"source": {
"mode": "synthetic"
}
}
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.stacktraces.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"index": {
"auto_expand_replicas": "0-1",
"refresh_interval": "10s",
"hidden": true
"hidden": true,
"mapping": {
"source": {
"mode": "synthetic"
}
}
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.sq.executables.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
"index": {
"auto_expand_replicas": "0-1",
"refresh_interval": "10s",
"hidden": true
"hidden": true,
"mapping": {
"source": {
"mode": "synthetic"
}
}
}
},
"mappings": {
"_source": {
"mode": "synthetic"
},
"_meta": {
"index-template-version": ${xpack.profiling.template.version},
"index-version": ${xpack.profiling.index.sq.leafframes.version},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public class ProfilingIndexTemplateRegistry extends IndexTemplateRegistry {
// version 11: Added 'profiling.agent.protocol' keyword mapping to profiling-hosts
// version 12: Added 'profiling.agent.env_https_proxy' keyword mapping to profiling-hosts
// version 13: Added 'container.id' keyword mapping to profiling-events
public static final int INDEX_TEMPLATE_VERSION = 13;
public static final int INDEX_TEMPLATE_VERSION = 14;

// 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 = 5;
Expand Down

0 comments on commit d5c051d

Please sign in to comment.