You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: develop-docs/sdk/telemetry/spans/span-protocol.mdx
+49Lines changed: 49 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -220,3 +220,52 @@ Example:
220
220
trace_id: "6cf173d587eb48568a9b2e12dcfbea52"
221
221
span_id: "438f40bd3b4a41ee"
222
222
```
223
+
224
+
## Span Attachments
225
+
226
+
The SDK must implement a new "attachment v2" envelope item, which is used to emit span attachments to Sentry. A span attachment should be emitted in the same envelope as its owner span, so that it can be dropped when the span itself is filtered or rate limited.
227
+
228
+
### Attachment v2 Envelope Item Header
229
+
230
+
The envelope item header must contain the following properties:
-`meta_length` is the size of the metadata portion of the payload in bytes (see item description below).
243
+
-`span_id` is the ID of the span that owns the attachment. `span_id: null` is treated as “owned by spans”, but not owned by a specific span. That is, the attachment can be dropped if the span quota is exceeded, but it will not be dropped with a specific span because of e.g. inbound filters.
244
+
245
+
## Attachment v2 Envelope Item Payload
246
+
247
+
The attachment item payload consists of JSON object containing metadata followed by the attachment body. For example, for a plain text attachment with the body "Hello World!", the item payload would look like this:
// Arbitrary key value pairs that will end up in EAP.
257
+
"foo": {"type": "string", "value": "bar"}
258
+
}
259
+
}helloworld
260
+
```
261
+
262
+
| Property | Type | Required | Description |
263
+
|----------|------|----------|-------------|
264
+
|`attachment_id`| string | Yes | 32-character hexadecimal string (a valid [Version 7](https://en.wikipedia.org/wiki/Universally_unique_identifier#Version_7_(timestamp_and_random)) or Version 4 UUID without dashes) |
265
+
|`timestamp`| float | Yes | a UNIX timestamp corresponding to the attachment's occurrence. It may be the same as the start or end timestamp of the owner span. |
266
+
|`filename`| string | No | The file name of the attachment. |
267
+
|`content_type`| string | Yes | the content type of the attachment body (not to be confused with the content type of the envelope item, which is always `application/vnd.sentry.attachment.v2`). |
268
+
|`attributes`| object | No | arbitrary attributes that will be queryable on the attachment trace item, similar to spans, logs, and trace metrics. |
0 commit comments