|
| 1 | +--- |
| 2 | +title: Envelope Items |
| 3 | +sidebar_order: 2 |
| 4 | +--- |
| 5 | + |
| 6 | +Each Envelope consists of headers and a potentially empty list of Items, each |
| 7 | +with their own headers. Which Headers are required depends on the Items in an |
| 8 | +Envelope. This section describes all Item types and their respective required |
| 9 | +headers. It is worth noting that the list of Item types doesn't match the data |
| 10 | +categories used for [rate limiting](/sdk/rate-limiting/#definitions) and |
| 11 | +client reports. |
| 12 | + |
| 13 | +The type of an Item is declared in the `type` header, as well as the payload |
| 14 | +size in `length`. See Serialization Format for a list of common Item headers. |
| 15 | +The headers described in this section are **in addition to the common headers**. |
| 16 | + |
| 17 | +### Event |
| 18 | + |
| 19 | +Item type `"event"`. This Item contains an error or default event payload |
| 20 | +encoded in JSON. |
| 21 | + |
| 22 | +**Constraints:** |
| 23 | + |
| 24 | +- This Item may occur at most once per Envelope. |
| 25 | +- This Item is mutually exclusive with `"transaction"` Items. |
| 26 | + |
| 27 | +**Envelope Headers:** |
| 28 | + |
| 29 | +`event_id` |
| 30 | + |
| 31 | +: **UUID String, required.** Corresponds to the `event_id` field of the event |
| 32 | + payload. Clients are required to generate an event identifier ahead of time |
| 33 | + and set it at least in the Envelope headers. If the identifier mismatches |
| 34 | + between the Envelope and payload, the Envelope header takes precedence. |
| 35 | + |
| 36 | +**Additional Item Headers:** |
| 37 | + |
| 38 | +*None* |
| 39 | + |
| 40 | +### Transaction |
| 41 | + |
| 42 | +Item type `"transaction"`. This Item contains a transaction payload encoded |
| 43 | +in JSON. |
| 44 | + |
| 45 | +**Constraints:** |
| 46 | + |
| 47 | +- This Item may occur at most once per Envelope. |
| 48 | +- This Item is mutually exclusive with `"event"` Items. |
| 49 | + |
| 50 | +**Envelope Headers:** |
| 51 | + |
| 52 | +`event_id` |
| 53 | + |
| 54 | +: **UUID String, required.** Corresponds to the `event_id` field of the |
| 55 | + transaction payload. Clients are required to generate an event identifier |
| 56 | + ahead of time and set it at least in the Envelope headers. If the identifier |
| 57 | + mismatches between the Envelope and payload, the Envelope header takes |
| 58 | + precedence. |
| 59 | + |
| 60 | +**Additional Item Headers:** |
| 61 | + |
| 62 | +*None* |
| 63 | + |
| 64 | +### Attachment |
| 65 | + |
| 66 | +Item type `"attachment"`. This Item contains a raw payload of an attachment |
| 67 | +file. It is always associated to an event or transaction. |
| 68 | + |
| 69 | +**Constraints:** |
| 70 | + |
| 71 | +- This Item may occur multiple times per Envelope. |
| 72 | +- For **minidump** and **apple crash report** attachments, the corresponding |
| 73 | + `"event"` Item must be sent within the same Envelope. |
| 74 | +- Generic attachments can be ingested separately from their events. We recommend |
| 75 | + sending them in the same Envelope, which allows for more efficient rate |
| 76 | + limiting and filtering. |
| 77 | +- Generic attachments sent in separate Envelopes can be dropped independently of |
| 78 | + an event. To ensure consistent handling, consider sending them in the same |
| 79 | + request. |
| 80 | +- The Sentry server supports special attachments to ingest event payloads for |
| 81 | + backwards compatibility. These are not part of the official public API and the |
| 82 | + behavior should not be relied upon. |
| 83 | + |
| 84 | +**Envelope Headers:** |
| 85 | + |
| 86 | +`event_id` |
| 87 | + |
| 88 | +: **UUID String, required.** The identifier of the event or transaction. |
| 89 | + |
| 90 | +**Additional Item Headers:** |
| 91 | + |
| 92 | +`filename` |
| 93 | + |
| 94 | +: **String, required.** The name of the uploaded file without a path component. |
| 95 | + |
| 96 | +`attachment_type` |
| 97 | + |
| 98 | +: *String, optional.* The special type of this attachment. Possible values are: |
| 99 | + |
| 100 | + - **`event.attachment` (default)**: A standard attachment without special |
| 101 | + meaning. |
| 102 | + - `event.minidump`: A minidump file that creates an error event and is |
| 103 | + symbolicated. The file should start with the `MDMP` magic bytes. |
| 104 | + - `event.applecrashreport`: An Apple crash report file that creates an error |
| 105 | + event and is symbolicated. |
| 106 | + - `unreal.context`: An XML file containing UE4 crash meta data. During event |
| 107 | + ingestion, event contexts and extra fields are extracted from this file. |
| 108 | + - `unreal.logs`: A plain-text log file obtained from UE4 crashes. During |
| 109 | + event ingestion, the last logs are extracted into event breadcrumbs. |
| 110 | + - `event.view_hierarchy`: An JSON file with a predefined structure, see [RFC #33](https://github.com/getsentry/rfcs/blob/main/text/0033-view-hierarchy.md). |
| 111 | + |
| 112 | +`content_type` |
| 113 | + |
| 114 | +: *String, optional.* The content type of the attachment payload. Any [MIME type](https://www.iana.org/assignments/media-types/media-types.xhtml) may be used; the default is `application/octet-stream`. |
| 115 | + |
| 116 | +### Session |
| 117 | + |
| 118 | +Item type `"session"` contains a single session initialization or update to an |
| 119 | +existing session for Release Health. |
| 120 | + |
| 121 | +See the <Link to="/sdk/sessions/">sessions</Link> documentation for the payload |
| 122 | +details. |
| 123 | + |
| 124 | +**Constraints:** |
| 125 | + |
| 126 | +- This Item may occur multiple times per Envelope. |
| 127 | +- Ingestion may limit the maximum number of Items per Envelope, see *Ingestion*. |
| 128 | + |
| 129 | +**Additional Item Headers:** |
| 130 | + |
| 131 | +*None* |
| 132 | + |
| 133 | +### Sessions |
| 134 | + |
| 135 | +Item type `"sessions"` contains buckets of pre-aggregated session counts. |
| 136 | + |
| 137 | +See the <Link to="/sdk/sessions/">sessions</Link> documentation for the payload |
| 138 | +details. |
| 139 | + |
| 140 | +**Constraints:** |
| 141 | + |
| 142 | +- This Item may occur multiple times per Envelope. |
| 143 | +- Ingestion may limit the maximum number of Items per Envelope, see *Ingestion*. |
| 144 | + |
| 145 | +**Additional Item Headers:** |
| 146 | + |
| 147 | +*None* |
| 148 | + |
| 149 | +### Statsd |
| 150 | + |
| 151 | +Item type `"statsd"` contains metrics emissions in a superset of the statsd format. |
| 152 | + |
| 153 | +See the <Link to="/sdk/metrics/">metrics</Link> documentation for the payload |
| 154 | +details. |
| 155 | + |
| 156 | +**Constraints:** |
| 157 | + |
| 158 | +- This Item may occur multiple times per Envelope. |
| 159 | +- Ingestion may limit the maximum number of Items per Envelope, see *Ingestion*. |
| 160 | + |
| 161 | +**Additional Item Headers:** |
| 162 | + |
| 163 | +*None* |
| 164 | + |
| 165 | +### Metric Meta |
| 166 | + |
| 167 | +Item type `"metric_meta"` contains per-metric meta data which is persisted alongside |
| 168 | +metrics in the system. |
| 169 | + |
| 170 | +See the <Link to="/sdk/metrics/">metrics</Link> documentation for the payload |
| 171 | +details. |
| 172 | + |
| 173 | +**Constraints:** |
| 174 | + |
| 175 | +- This Item may occur multiple times per Envelope. |
| 176 | +- Ingestion may limit the maximum number of Items per Envelope, see *Ingestion*. |
| 177 | + |
| 178 | +**Additional Item Headers:** |
| 179 | + |
| 180 | +*None* |
| 181 | + |
| 182 | +### User Feedback |
| 183 | + |
| 184 | +User Feedback was called User Report in the beginning. Therefore the envelope item type is `"user_report"`. |
| 185 | +The item contains a user feedback / user report JSON payload: |
| 186 | +```json |
| 187 | +{ "event_id": "9ec79c33ec9942ab8353589fcb2e04dc", "email": "[email protected]", "name": "John Me", "comments": "It broke."} \n |
| 188 | +``` |
| 189 | + |
| 190 | +**Attributes** |
| 191 | + |
| 192 | +`event_id` |
| 193 | + |
| 194 | +: **UUID String, required.** The identifier of the event or transaction. |
| 195 | + |
| 196 | + |
| 197 | +`email` |
| 198 | + |
| 199 | +: *String, recommended.* The email of the user. |
| 200 | + |
| 201 | +`name` |
| 202 | + |
| 203 | +: *String, recommended.* The name of the user. |
| 204 | + |
| 205 | +`comments` |
| 206 | + |
| 207 | +: *String, recommended.* Comments of the user about what happened. |
| 208 | + |
| 209 | +**Constraints:** |
| 210 | + |
| 211 | +- This Item may occur once per Envelope. |
| 212 | +- User Feedbacks / Reports can be ingested separately from their events. We recommended to |
| 213 | + send them in the same Envelope. |
| 214 | + |
| 215 | +**Envelope Headers:** |
| 216 | + |
| 217 | +`event_id` |
| 218 | + |
| 219 | +: **UUID String, required.** The identifier of the event or transaction. |
| 220 | + |
| 221 | +**Additional Item Headers:** |
| 222 | + |
| 223 | +*None* |
| 224 | + |
| 225 | +### Client Report |
| 226 | + |
| 227 | +Item type `"client_report"` contains a client report payload encoded in JSON. |
| 228 | + |
| 229 | +See the <Link to="/sdk/client-reports/">client reports</Link> documentation for the payload |
| 230 | +details. |
| 231 | + |
| 232 | +**Constraints:** |
| 233 | + |
| 234 | +- This Item may occur multiple times per Envelope, but please avoid sending more client reports than necessary. |
| 235 | +- This Item can either be included in an Envelope with other Items, or it may be sent by itself. |
| 236 | + |
| 237 | +**Envelope Headers:** |
| 238 | + |
| 239 | +*None* |
| 240 | + |
| 241 | +**Additional Item Headers:** |
| 242 | + |
| 243 | +*None* |
| 244 | + |
| 245 | +### Replay Event |
| 246 | + |
| 247 | +Item type `"replay_event"` contains a replay payload encoded in JSON. |
| 248 | + |
| 249 | +See the <Link to="/sdk/replays/">replays</Link> documentation for the payload |
| 250 | +details. |
| 251 | + |
| 252 | +**Constraints:** |
| 253 | + |
| 254 | +- This Item may occur at most once per Envelope. |
| 255 | +- This Item must be sent with a Replay Recording Item. |
| 256 | + |
| 257 | +**Envelope Headers:** |
| 258 | + |
| 259 | +*None* |
| 260 | + |
| 261 | +**Additional Item Headers:** |
| 262 | + |
| 263 | +*None* |
| 264 | + |
| 265 | +### Replay Recording |
| 266 | + |
| 267 | +Item type `"replay_recording"` contains a replay recording payload encoded in JSON *or* a gzipped JSON. |
| 268 | + |
| 269 | +See the <Link to="/sdk/replays/">replays</Link> documentation for the payload |
| 270 | +details. |
| 271 | + |
| 272 | +**Constraints:** |
| 273 | + |
| 274 | +- This Item may occur at most once per Envelope. |
| 275 | +- This Item must be sent with a Replay Recording Item. |
| 276 | + |
| 277 | +**Envelope Headers:** |
| 278 | + |
| 279 | +*None* |
| 280 | + |
| 281 | +**Additional Item Headers:** |
| 282 | + |
| 283 | +`length` |
| 284 | + |
| 285 | +: **integer, required.** The size of the Replay recording payload |
| 286 | + |
| 287 | +### Profile |
| 288 | + |
| 289 | +Item type `"profile"`. This Item contains a profile payload encoded |
| 290 | +in JSON. |
| 291 | + |
| 292 | +**Constraints:** |
| 293 | + |
| 294 | +- This Item may occur at most once per Envelope. |
| 295 | +- This Item needs to be in the same Envelope as the associated transaction. |
| 296 | + |
| 297 | +**Envelope Headers:** |
| 298 | + |
| 299 | +*None* |
| 300 | + |
| 301 | +**Additional Item Headers:** |
| 302 | + |
| 303 | +*None* |
| 304 | + |
| 305 | +### Profile Chunk |
| 306 | + |
| 307 | +Item type `"profile_chunk"`. This Item contains a profile_chunk (profile sample format V2) payload encoded |
| 308 | +in JSON. |
| 309 | + |
| 310 | +**Constraints:** |
| 311 | + |
| 312 | +*None* |
| 313 | + |
| 314 | +**Envelope Headers:** |
| 315 | + |
| 316 | +*None* |
| 317 | + |
| 318 | +**Additional Item Headers:** |
| 319 | + |
| 320 | +*None* |
| 321 | + |
| 322 | +### Check-Ins |
| 323 | + |
| 324 | +Item type `"check_in"` contains a check-in payload encoded as JSON. |
| 325 | + |
| 326 | +See the <Link to="/sdk/check-ins/">Check-Ins</Link> documentation for the payload |
| 327 | +details. |
| 328 | + |
| 329 | +**Constraints:** |
| 330 | + |
| 331 | +- This Item may occur at most once per Envelope. |
| 332 | +- This Item can either be included in an Envelope with other Items, or it may be sent by itself. |
| 333 | + |
| 334 | +**Envelope Headers:** |
| 335 | + |
| 336 | +*None* |
| 337 | + |
| 338 | +**Additional Item Headers:** |
| 339 | + |
| 340 | +*None* |
| 341 | + |
| 342 | +### Reserved Types |
| 343 | + |
| 344 | +Reserved types may not be written by any implementation. They are reserved for |
| 345 | +future or internal use. This is the exhaustive list of reserved Item types: |
| 346 | + |
| 347 | +- `security` |
| 348 | +- `unreal_report` |
| 349 | +- `form_data` |
0 commit comments