From 6416df750ed4f16876e20aeb31f488dc5d6871f9 Mon Sep 17 00:00:00 2001 From: Karl Heinz Struggl Date: Thu, 18 Apr 2024 07:14:08 -0700 Subject: [PATCH] Add expected User-Agent format to SDK docs (#1222) * 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 --------- Co-authored-by: Joris Bayer --- src/docs/sdk/overview.mdx | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/src/docs/sdk/overview.mdx b/src/docs/sdk/overview.mdx index c1995fbc0e..247fc92d48 100644 --- a/src/docs/sdk/overview.mdx +++ b/src/docs/sdk/overview.mdx @@ -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: @@ -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