Skip to content

Document payload size for javascript SDK #310

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

Merged
merged 1 commit into from
Sep 4, 2018
Merged
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
4 changes: 3 additions & 1 deletion src/collections/_documentation/clients/javascript/config.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,12 +299,14 @@ Those configuration options are documented below:

: `fetch()` init parameters ([https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters)).

Setting `keepalive: true` parameter will allow SDK to send events in `unload` and `beforeunload` handlers.
However, it'll also restrict the size of a single event to 64kB, per [fetch specification](https://fetch.spec.whatwg.org/#http-network-or-cache-fetch) (point 8.5).

Defaults:

```javascript
{
method: 'POST',
keepalive: true,
referrerPolicy: 'origin'
}
```
Expand Down
4 changes: 4 additions & 0 deletions src/collections/_documentation/clients/javascript/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,10 @@ The `captureMessage`, `captureException`, `context`, and `wrap` functions all al
Raven.setTagsContext(tags); // Add back the tags you want to keep.
```

**Be aware of maximal payload size** - There are times, when you want to send a whole application state as an extra data.
This can be quite a large object, which can easily weigh more than 200kB, which is currently maximamal payload size of a single event sent to Sentry.
When this happens, you'll get an `HTTP Error 413 Payload Too Large` as the server response or (when `keepalive: true` is set as `fetch` parameter) request will stay in `pending` state forever (eg. in Chrome).

`extra`

: Arbitrary data to associate with the event.
Expand Down