Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(develop): Add page context #13203

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 44 additions & 1 deletion develop-docs/sdk/data-model/event-payloads/contexts.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,49 @@ envelope endpoint.
}
```

## Page Context

Page context contains information about the page that the event occurred on.

`url`

: **Required.** The URL of the page that the event occurred on, excluding query parameters & fragment.

- Example: `https://sentry.io/issues`

`http.query`

: **Optional.** The query parameters of the page that the event occurred on.

- Example: `?page=1`

`http.fragment`

: **Optional.** The fragment of the page that the event occurred on.

- Example: `#123`

`referer`

: _Optional_. The referer of the page that the event occurred on.

- Example: `https://sentry.io/`

**Example Page Context**

```json
{
"contexts": {
"page": {
"url": "https://sentry.io/issues",
"http.query": "?page=1",
"http.fragment": "#123",
"referer": "https://sentry.io/"
}
}
}
```

## Response Context

Response context contains information about the HTTP response associated with the event.
Expand Down Expand Up @@ -829,7 +872,7 @@ The required field is `package` which should contain the package or framework wh
"contexts": {
"missing_instrumentation": {
"package": "express",
"javascript.is_cjs": true,
"javascript.is_cjs": true
}
}
}
Expand Down
5 changes: 2 additions & 3 deletions develop-docs/sdk/data-model/event-payloads/request.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,8 @@ sidebar_order: 8
---

The Request interface contains information on a HTTP request related to the
event. In client SDKs, this can be an outgoing request, or the request that
rendered the current web page. On server SDKs, this could be the incoming web
request that is being handled.
event. In client SDKs, this can be an outgoing request (use the [page context](../contexts/#page-context) to track the page that the request was made from).
On server SDKs, this could be the incoming web request that is being handled.

The data variable should only contain the request body (not the query string).
It can either be a dictionary (for standard HTTP requests) or a raw request
Expand Down