Skip to content

Commit 3fde207

Browse files
committed
apm-data: ignore_{malformed,dynamic_beyond_limit}
Enable ignore_malformed on all non-metrics APM data streams, and enable ignore_dynamic_beyond_limit for all APM data streams. We can enable ignore_malformed on metrics data streams when elastic#90007 is fixed.
1 parent e56ed71 commit 3fde207

File tree

4 files changed

+111
-1
lines changed

4 files changed

+111
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,7 @@ template:
88
sort:
99
field: "@timestamp"
1010
order: desc
11+
mapping:
12+
ignore_malformed: true
13+
total_fields:
14+
ignore_dynamic_beyond_limit: true

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ _meta:
66
template:
77
settings:
88
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

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: 3
4+
version: 4
55

66
component-templates:
77
# Data lifecycle.
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
---
2+
setup:
3+
- do:
4+
cluster.health:
5+
wait_for_events: languid
6+
7+
- do:
8+
cluster.put_component_template:
9+
name: "logs-apm.app@custom"
10+
body:
11+
template:
12+
settings:
13+
mapping:
14+
total_fields:
15+
limit: 20
16+
17+
---
18+
"Test ignore_malformed":
19+
- do:
20+
bulk:
21+
index: traces-apm-testing
22+
refresh: true
23+
body:
24+
# Passing a (non-coercable) string into a numeric field should not
25+
# cause an indexing failure; it should just not be indexed.
26+
- create: {}
27+
- '{"@timestamp": "2017-06-22", "numeric_labels": {"key": "string"}}'
28+
- create: {}
29+
- '{"@timestamp": "2017-06-22", "numeric_labels": {"key": 123}}'
30+
31+
- is_false: errors
32+
33+
- do:
34+
search:
35+
index: traces-apm-testing
36+
body:
37+
fields: ["numeric_labels.*", "_ignored"]
38+
- length: { hits.hits: 2 }
39+
- match: { hits.hits.0.fields: {"_ignored": ["numeric_labels.key"]} }
40+
- match: { hits.hits.1.fields: {"numeric_labels.key": [123.0]} }
41+
42+
---
43+
"Test ignore_dynamic_beyond_limit":
44+
- do:
45+
bulk:
46+
index: logs-apm.app.svc1-testing
47+
refresh: true
48+
body:
49+
- create: {}
50+
- {"@timestamp": "2017-06-22", "k1": ""}
51+
- create: {}
52+
- {"@timestamp": "2017-06-22", "k2": ""}
53+
- create: {}
54+
- {"@timestamp": "2017-06-22", "k3": ""}
55+
- create: {}
56+
- {"@timestamp": "2017-06-22", "k4": ""}
57+
- create: {}
58+
- {"@timestamp": "2017-06-22", "k5": ""}
59+
- create: {}
60+
- {"@timestamp": "2017-06-22", "k6": ""}
61+
- create: {}
62+
- {"@timestamp": "2017-06-22", "k7": ""}
63+
- create: {}
64+
- {"@timestamp": "2017-06-22", "k8": ""}
65+
- create: {}
66+
- {"@timestamp": "2017-06-22", "k9": ""}
67+
- create: {}
68+
- {"@timestamp": "2017-06-22", "k10": ""}
69+
- create: {}
70+
- {"@timestamp": "2017-06-22", "k11": ""}
71+
- create: {}
72+
- {"@timestamp": "2017-06-22", "k12": ""}
73+
- create: {}
74+
- {"@timestamp": "2017-06-22", "k13": ""}
75+
- create: {}
76+
- {"@timestamp": "2017-06-22", "k14": ""}
77+
- create: {}
78+
- {"@timestamp": "2017-06-22", "k15": ""}
79+
- create: {}
80+
- {"@timestamp": "2017-06-22", "k16": ""}
81+
- create: {}
82+
- {"@timestamp": "2017-06-22", "k17": ""}
83+
- create: {}
84+
- {"@timestamp": "2017-06-22", "k18": ""}
85+
- create: {}
86+
- {"@timestamp": "2017-06-22", "k19": ""}
87+
- create: {}
88+
- {"@timestamp": "2017-06-22", "k20": ""}
89+
90+
- is_false: errors
91+
92+
- do:
93+
search:
94+
index: logs-apm.app.svc1-testing
95+
body:
96+
query:
97+
term:
98+
_ignored:
99+
value: k20
100+
- length: { hits.hits: 1 }

0 commit comments

Comments
 (0)