File tree Expand file tree Collapse file tree 5 files changed +42
-17
lines changed
x-pack/plugin/otel-data/src
yamlRestTest/resources/rest-api-spec/test Expand file tree Collapse file tree 5 files changed +42
-17
lines changed Original file line number Diff line number Diff line change 1+ pr : 114856
2+ summary : " OTel mappings: avoid metrics to be rejected when attributes are malformed"
3+ area : Data streams
4+ type : bug
5+ issues : []
Original file line number Diff line number Diff line change 33 description : Default mappings for the OpenTelemetry metrics index template installed by x-pack
44 managed : true
55template :
6+ settings :
7+ index.mapping.ignore_malformed : true
68 mappings :
79 properties :
810 start_timestamp :
@@ -19,27 +21,22 @@ template:
1921 - histogram :
2022 mapping :
2123 type : histogram
22- ignore_malformed : true
2324 - counter_long :
2425 mapping :
2526 type : long
2627 time_series_metric : counter
27- ignore_malformed : true
2828 - gauge_long :
2929 mapping :
3030 type : long
3131 time_series_metric : gauge
32- ignore_malformed : true
3332 - counter_double :
3433 mapping :
3534 type : double
3635 time_series_metric : counter
37- ignore_malformed : true
3836 - gauge_double :
3937 mapping :
4038 type : double
4139 time_series_metric : gauge
42- ignore_malformed : true
4340 - summary :
4441 mapping :
4542 type : aggregate_metric_double
Original file line number Diff line number Diff line change @@ -27,14 +27,3 @@ template:
2727 data_stream.type :
2828 type : constant_keyword
2929 value : metrics
30- dynamic_templates :
31- - ecs_ip :
32- mapping :
33- type : ip
34- path_match : [ "ip", "*.ip", "*_ip" ]
35- match_mapping_type : string
36- - all_strings_to_keywords :
37- mapping :
38- ignore_above : 1024
39- type : keyword
40- match_mapping_type : string
Original file line number Diff line number Diff line change 11# "version" holds the version of the templates and ingest pipelines installed
22# by xpack-plugin otel-data. This must be increased whenever an existing template is
33# changed, in order for it to be updated on Elasticsearch upgrade.
4- version : 5
4+ version : 6
55
66component-templates :
77 - otel@mappings
Original file line number Diff line number Diff line change @@ -245,3 +245,37 @@ IP dimensions:
245245 - match : { .$idx0name.mappings.properties.metrics.properties.summary.type: 'aggregate_metric_double' }
246246 - match : { .$idx0name.mappings.properties.metrics.properties.summary_minmax.type: 'aggregate_metric_double' }
247247 - match : { .$idx0name.mappings.properties.metrics.properties.histogram.type: 'histogram' }
248+ ---
249+ Empty IP field :
250+ - do :
251+ bulk :
252+ index : metrics-generic.otel-default
253+ refresh : true
254+ body :
255+ - create : {"dynamic_templates":{"metrics.foo.bar":"counter_long"}}
256+ - " @timestamp " : 2024-07-18T14:48:33.467654000Z
257+ resource :
258+ attributes :
259+ host.name : localhost
260+ host.ip : " "
261+ metrics :
262+ foo.bar : 42
263+ - is_false : errors
264+
265+ - do :
266+ indices.get_data_stream :
267+ name : metrics-generic.otel-default
268+ - set : { data_streams.0.indices.0.index_name: idx0name }
269+
270+ - do :
271+ indices.get_mapping :
272+ index : $idx0name
273+ expand_wildcards : hidden
274+ - match : { .$idx0name.mappings.properties.resource.properties.attributes.properties.host\.ip.type: 'ip' }
275+ - do :
276+ search :
277+ index : metrics-generic.otel-default
278+ body :
279+ fields : ["*"]
280+ - length : { hits.hits: 1 }
281+ - match : { hits.hits.0._ignored: ["resource.attributes.host.ip"] }
You can’t perform that action at this time.
0 commit comments