Skip to content

Commit 4457e32

Browse files
authored
Map RUM PerformanceResourceTiming fields (#9429)
Add field mappings for: - http.response.transfer_size - http.response.encoded_body_size - http.response.decoded_body_size The fields are mapped with `index: false`, to minimise storage overhead. They can still be used in searches, just a bit slower. The intake schema for these fields has been changed from float64 to int, as these are originally integer values. See https://w3c.github.io/resource-timing/#sec-performanceresourcetiming testdata, and hence approvals, have been updated to change the mock values from floats to integers.
1 parent 77c47ee commit 4457e32

25 files changed

+95
-78
lines changed

apmpackage/apm/changelog.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
- description: Enable synthetic source for metrics data streams
1010
type: enhancement
1111
link: https://github.com/elastic/apm-server/pull/9215
12+
- description: Add mappings for RUM `http.response.*_size` fields
13+
type: enhancement
14+
link: https://github.com/elastic/apm-server/pull/9429
1215
- version: "8.5.0"
1316
changes:
1417
- description: Add package settings to enable the experimental collection of service metrics

apmpackage/apm/data_stream/traces/fields/fields.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,26 @@
5858
type: object
5959
description: |
6060
The canonical headers of the monitored HTTP response.
61+
- name: http.response.transfer_size
62+
type: long
63+
unit: byte
64+
index: false
65+
description: |
66+
The size (in octets) of the fetched resource.
67+
The size includes the response header fields plus the response payload body (as defined by RFC7230).
68+
- name: http.response.encoded_body_size
69+
type: long
70+
unit: byte
71+
index: false
72+
description: |
73+
The size (in octets) received from the fetch (HTTP or cache), of the payload body, before removing any applied content-codings.
74+
- name: http.response.decoded_body_size
75+
type: long
76+
index: false
77+
description: |
78+
The size (in octets) received from the fetch (HTTP or cache) of the message body, after removing any applied content-codings.
79+
If the resource is retrieved from an application cache or local resources,
80+
it returns the size of the payload after removing any applied content-codings.
6181
- name: kubernetes.namespace
6282
type: keyword
6383
description: |

changelogs/head.asciidoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ https://github.com/elastic/apm-server/compare/8.5\...main[View commits]
77
==== Breaking Changes
88
- `apm-server.decoder.*` stack monitoring metrics are no longer recorded {pull}9210[9210]
99
- `ecs.version` is no longer added to document `_source`; it is added as a `constant_keyword` field {pull}9208[9208]
10+
- `context.http.response.*_size` fields now enforce integer values {pull}9429[9429]
1011

1112
[float]
1213
==== Deprecations
@@ -19,6 +20,7 @@ Set error.id for OpenTelemetry exception span events {pull}9372[9372]
1920
==== Intake API Changes
2021
- experimental:[] Extend logs v2 intake API to support ECS logging fields {pull}9349[9349]
2122
- experimental:[] Add support for string timestamp format(`2006-01-02T15:04:05.999-0700`) {pull}9376[9376]
23+
- `context.http.response.*_size` fields have been changed from floating-point to integer types {pull}9429[9429]
2224

2325
[float]
2426
==== Added

docs/spec/rumv3/error.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@
118118
"description": "DecodedBodySize holds the size of the decoded payload.",
119119
"type": [
120120
"null",
121-
"number"
121+
"integer"
122122
]
123123
},
124124
"ebs": {
125125
"description": "EncodedBodySize holds the size of the encoded payload.",
126126
"type": [
127127
"null",
128-
"number"
128+
"integer"
129129
]
130130
},
131131
"he": {
@@ -159,7 +159,7 @@
159159
"description": "TransferSize holds the total size of the payload.",
160160
"type": [
161161
"null",
162-
"number"
162+
"integer"
163163
]
164164
}
165165
}

docs/spec/rumv3/span.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,21 +116,21 @@
116116
"description": "DecodedBodySize holds the size of the decoded payload.",
117117
"type": [
118118
"null",
119-
"number"
119+
"integer"
120120
]
121121
},
122122
"ebs": {
123123
"description": "EncodedBodySize holds the size of the encoded payload.",
124124
"type": [
125125
"null",
126-
"number"
126+
"integer"
127127
]
128128
},
129129
"ts": {
130130
"description": "TransferSize holds the total size of the payload.",
131131
"type": [
132132
"null",
133-
"number"
133+
"integer"
134134
]
135135
}
136136
}

docs/spec/rumv3/transaction.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -118,14 +118,14 @@
118118
"description": "DecodedBodySize holds the size of the decoded payload.",
119119
"type": [
120120
"null",
121-
"number"
121+
"integer"
122122
]
123123
},
124124
"ebs": {
125125
"description": "EncodedBodySize holds the size of the encoded payload.",
126126
"type": [
127127
"null",
128-
"number"
128+
"integer"
129129
]
130130
},
131131
"he": {
@@ -159,7 +159,7 @@
159159
"description": "TransferSize holds the total size of the payload.",
160160
"type": [
161161
"null",
162-
"number"
162+
"integer"
163163
]
164164
}
165165
}
@@ -720,21 +720,21 @@
720720
"description": "DecodedBodySize holds the size of the decoded payload.",
721721
"type": [
722722
"null",
723-
"number"
723+
"integer"
724724
]
725725
},
726726
"ebs": {
727727
"description": "EncodedBodySize holds the size of the encoded payload.",
728728
"type": [
729729
"null",
730-
"number"
730+
"integer"
731731
]
732732
},
733733
"ts": {
734734
"description": "TransferSize holds the total size of the payload.",
735735
"type": [
736736
"null",
737-
"number"
737+
"integer"
738738
]
739739
}
740740
}

docs/spec/v2/error.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -355,14 +355,14 @@
355355
"description": "DecodedBodySize holds the size of the decoded payload.",
356356
"type": [
357357
"null",
358-
"number"
358+
"integer"
359359
]
360360
},
361361
"encoded_body_size": {
362362
"description": "EncodedBodySize holds the size of the encoded payload.",
363363
"type": [
364364
"null",
365-
"number"
365+
"integer"
366366
]
367367
},
368368
"finished": {
@@ -410,7 +410,7 @@
410410
"description": "TransferSize holds the total size of the payload.",
411411
"type": [
412412
"null",
413-
"number"
413+
"integer"
414414
]
415415
}
416416
}

docs/spec/v2/span.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@
192192
"description": "DecodedBodySize holds the size of the decoded payload.",
193193
"type": [
194194
"null",
195-
"number"
195+
"integer"
196196
]
197197
},
198198
"encoded_body_size": {
199199
"description": "EncodedBodySize holds the size of the encoded payload.",
200200
"type": [
201201
"null",
202-
"number"
202+
"integer"
203203
]
204204
},
205205
"headers": {
@@ -233,7 +233,7 @@
233233
"description": "TransferSize holds the total size of the payload.",
234234
"type": [
235235
"null",
236-
"number"
236+
"integer"
237237
]
238238
}
239239
}

docs/spec/v2/transaction.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -354,14 +354,14 @@
354354
"description": "DecodedBodySize holds the size of the decoded payload.",
355355
"type": [
356356
"null",
357-
"number"
357+
"integer"
358358
]
359359
},
360360
"encoded_body_size": {
361361
"description": "EncodedBodySize holds the size of the encoded payload.",
362362
"type": [
363363
"null",
364-
"number"
364+
"integer"
365365
]
366366
},
367367
"finished": {
@@ -409,7 +409,7 @@
409409
"description": "TransferSize holds the total size of the payload.",
410410
"type": [
411411
"null",
412-
"number"
412+
"integer"
413413
]
414414
}
415415
}

internal/beater/test_approved_es_documents/TestPublishIntegrationEvents.approved.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@
333333
]
334334
},
335335
"status_code": 302,
336-
"transfer_size": 300.12
336+
"transfer_size": 30012
337337
}
338338
},
339339
"kubernetes": {
@@ -518,8 +518,8 @@
518518
"method": "POST"
519519
},
520520
"response": {
521-
"decoded_body_size": 401.9,
522-
"encoded_body_size": 356.9,
521+
"decoded_body_size": 40190,
522+
"encoded_body_size": 35690,
523523
"finished": true,
524524
"headers": {
525525
"Content-Type": [

0 commit comments

Comments
 (0)