Skip to content

Commit 55ef5e6

Browse files
gregkalaposfelixbarnyelasticmachine
authored
Remove dynamic templates from otel-plugin that set index:false (#113409)
* Remove dynamic templates from otel-plugin that set `index:false` * Update x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml Co-authored-by: Felix Barnsteiner <[email protected]> * Remove unused dynamic templates * Update [email protected] --------- Co-authored-by: Felix Barnsteiner <[email protected]> Co-authored-by: Elastic Machine <[email protected]>
1 parent fb4ebfb commit 55ef5e6

File tree

4 files changed

+48
-46
lines changed

4 files changed

+48
-46
lines changed

x-pack/plugin/core/template-resources/src/main/resources/[email protected]

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -43,50 +43,6 @@
4343
"default_metric": "value_count"
4444
}
4545
}
46-
},
47-
{
48-
"histogram": {
49-
"mapping": {
50-
"type": "histogram",
51-
"ignore_malformed": true
52-
}
53-
}
54-
},
55-
{
56-
"counter_long": {
57-
"mapping": {
58-
"type": "long",
59-
"time_series_metric": "counter",
60-
"ignore_malformed": true
61-
}
62-
}
63-
},
64-
{
65-
"gauge_long": {
66-
"mapping": {
67-
"type": "long",
68-
"time_series_metric": "gauge",
69-
"ignore_malformed": true
70-
}
71-
}
72-
},
73-
{
74-
"counter_double": {
75-
"mapping": {
76-
"type": "double",
77-
"time_series_metric": "counter",
78-
"ignore_malformed": true
79-
}
80-
}
81-
},
82-
{
83-
"gauge_double": {
84-
"mapping": {
85-
"type": "double",
86-
"time_series_metric": "gauge",
87-
"ignore_malformed": true
88-
}
89-
}
9046
}
9147
],
9248
"properties": {

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

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,33 @@ template:
1515
type: keyword
1616
time_series_dimension: true
1717
ignore_above: 1024
18+
dynamic_templates:
19+
- histogram:
20+
mapping:
21+
type: histogram
22+
ignore_malformed: true
23+
- counter_long:
24+
mapping:
25+
type: long
26+
time_series_metric: counter
27+
ignore_malformed: true
28+
- gauge_long:
29+
mapping:
30+
type: long
31+
time_series_metric: gauge
32+
ignore_malformed: true
33+
- counter_double:
34+
mapping:
35+
type: double
36+
time_series_metric: counter
37+
ignore_malformed: true
38+
- gauge_double:
39+
mapping:
40+
type: double
41+
time_series_metric: gauge
42+
ignore_malformed: true
43+
- summary:
44+
mapping:
45+
type: aggregate_metric_double
46+
metrics: sum, value_count
47+
default_metric: value_count

x-pack/plugin/otel-data/src/main/resources/index-templates/[email protected]

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ _meta:
88
description: default OpenTelemetry metrics template installed by x-pack
99
managed: true
1010
composed_of:
11-
- metrics@mappings
1211
- metrics@tsdb-settings
1312
- otel@mappings
1413
- metrics-otel@mappings
@@ -38,4 +37,3 @@ template:
3837
ignore_above: 1024
3938
type: keyword
4039
match_mapping_type: string
41-

x-pack/plugin/otel-data/src/yamlRestTest/resources/rest-api-spec/test/20_metrics_tests.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,3 +178,21 @@ IP dimensions:
178178
expand_wildcards: hidden
179179
- match: { .$idx0name.mappings.properties.resource.properties.attributes.properties.host\.ip.type: 'ip' }
180180
- match: { .$idx0name.mappings.properties.attributes.properties.philip.type: "keyword" }
181+
---
182+
"Long data type in attributes must be accepted":
183+
- do:
184+
indices.get_index_template:
185+
name: metrics-otel@template
186+
- length: {index_templates: 1}
187+
- do:
188+
bulk:
189+
index: metrics-generic.otel-default
190+
refresh: true
191+
body:
192+
- create: {}
193+
- '{"@timestamp":"2024-07-18T14:48:33.467654000Z","attributes":{"processor.pid": 17}}'
194+
- is_false: errors
195+
- do:
196+
search:
197+
index: metrics-generic.otel-default
198+
- length: { hits.hits: 1 }

0 commit comments

Comments
 (0)