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

Commit

Permalink
Add expected User-Agent format to SDK docs (#1222)
Browse files Browse the repository at this point in the history
* adds user-agent format

* adds info about semicolon separator

* adds examples for basic user agent

* Update src/docs/sdk/overview.mdx

Co-authored-by: Joris Bayer <[email protected]>

---------

Co-authored-by: Joris Bayer <[email protected]>
  • Loading branch information
kahest and jjbayer committed Apr 18, 2024
1 parent bc105e7 commit 6416df7
Showing 1 changed file with 25 additions and 0 deletions.
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}`
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})`
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

0 comments on commit 6416df7

Please sign in to comment.