Skip to content
This repository has been archived by the owner on Aug 14, 2024. It is now read-only.

Add expected User-Agent format to SDK docs #1222

Merged
merged 4 commits into from
Apr 18, 2024
Merged
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
25 changes: 25 additions & 0 deletions src/docs/sdk/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ We recommend always sending the following headers:

- `content-type`
- `content-length`
- `user-agent`

The following additional headers are permitted as per CORS policy:

Expand All @@ -229,6 +230,30 @@ The following additional headers are permitted as per CORS policy:
- `content-encoding`
- `transfer-encoding`

### User Agent

All SDKs are expected to report their name and version via the `user-agent` header.
The following format should be used (unless required or recommended differently by the platform,
e.g. for browser SDKs, where the user agent header must be set by the browser itself):

`{sdk-name}/{sdk-version}`
kahest marked this conversation as resolved.
Show resolved Hide resolved

For example:
- `sentry.python/1.45.0`
- `sentry.php/4.7.0`
- `sentry-ruby/5.17.3`
- `sentry.cocoa/8.24.0`

Additional information about the runtime, operating system, and others can be
appended as comments in parentheses, separated by `; ` (semicolon and space), like so:

`{sdk-name}/{sdk-version} ({runtime-name} {runtime-version}; {os-name} {os-version})`
kahest marked this conversation as resolved.
Show resolved Hide resolved

There is no expectation towards the presence or order of fields. The user agent
must not contain PII or otherwise sensitive data. In general it should not contain
any information that is not already present in the payload.


## Request Compression

SDKs are heavily encouraged to compress the request body before sending it to
Expand Down
Loading