Skip to content

Commit 1c7829b

Browse files
lciancoolguyzone
andauthored
feat(develop): Update Response Context (#14498)
<!-- Use this checklist to make sure your PR is ready for merge. You may delete any sections you don't need. --> ## DESCRIBE YOUR PR Document the Response Context for events, including all fields, according to the implementation in [Relay](https://github.com/getsentry/relay/blob/1bdc463896fb6f1425fac10915fa49799ecc5d85/relay-event-schema/src/protocol/contexts/response.rs#L11). Note that we don't include `inferred_content_type` because that's always overridden by Relay anyways. --------- Co-authored-by: Alex Krawiec <[email protected]>
1 parent a060e71 commit 1c7829b

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

develop-docs/sdk/data-model/event-payloads/contexts.mdx

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -795,23 +795,54 @@ Page context contains information about the page that the event occurred on.
795795

796796
Response context contains information about the HTTP response associated with the event.
797797

798-
The only and required field is `status_code`.
799-
800798
This is mostly set on transactions in a web server environment where one transaction represents a HTTP request/response cycle.
801799

800+
`cookies`
801+
802+
: _Optional_. The cookie values. Can be passed, unparsed, as a string, as a dictionary, or as a list of tuples.
803+
804+
- Example: `{ "PHPSESSID": "12345", "csrftoken": "1234567" }`
805+
806+
`headers`
807+
808+
: _Optional_. A dictionary of submitted headers. If a header appears multiple times it, needs to be merged according to the HTTP standard for header merging. Sentry treats header names as case-insensitive.
809+
810+
- Example: `{ "Content-Type": "text/plain" }`
811+
802812
`status_code`
803813

804814
: **Required.** The integer status code from the HTTP response associated with the event.
805815

806816
- Example: `200`
807817

818+
`body_size`
819+
820+
: _Optional_. HTTP response body size in bytes.
821+
822+
- Example: `1000`
823+
824+
`data`
825+
826+
: _Optional_. Response data in any format that makes sense. SDKs should discard large and binary bodies by default. Can be given as a string or structural data of any format.
827+
828+
- Example: `"Invalid request"`
829+
808830
**Example Response Context**
809831

810832
```json
811833
{
812834
"contexts": {
813835
"response": {
814-
"status_code": 404
836+
"cookies": {
837+
"PHPSESSID": "12345",
838+
"csrftoken": "1234567"
839+
},
840+
"headers": {
841+
"Content-Type": "text/plain"
842+
},
843+
"status_code": 500,
844+
"body_size": 1000,
845+
"data": "Invalid request"
815846
}
816847
}
817848
}

0 commit comments

Comments
 (0)