getsentry / team-sdks

A meta repository for tracking work across all SDK teams.
0 stars 0 forks source link

Chore: Align/extend User Agents #61

Open kahest opened 4 months ago

kahest commented 4 months ago

Description

Currently, some SDKs (e.g. sentry-cocoa) don't set a user agent or just set the SDK name as user agent. In an effort to make troubleshooting of issues more viable if only the http request headers are available (e.g. looking into LB issues), we want to add more information to the user agent:

### Define base and optional/additional format
- [ ] https://github.com/getsentry/develop/pull/1222
### Ensure SDKs use base format
- [ ] https://github.com/getsentry/sentry-cocoa/issues/3713
- [ ] https://github.com/getsentry/sentry-java/issues/3274
- [x] React Native
- [ ] https://github.com/getsentry/sentry-native/issues/957
- [x] [PHP](https://github.com/getsentry/sentry-php/blob/master/src/HttpClient/HttpClient.php?rgh-link-date=2024-02-28T16%3A33%3A16Z#L66)
- [x] [Go](https://github.com/getsentry/sentry-go/blob/master/transport.go?rgh-link-date=2024-02-28T16%3A33%3A16Z#L212)
- [x] [Python](https://github.com/getsentry/sentry-python/blob/e07a128a5ff6e646421ee14bce7b5856d8d6896c/sentry_sdk/transport.py#L152)
- [x] [Ruby](https://github.com/getsentry/sentry-ruby/blob/7d29d3c69e3ae76a6c0be8e2778e0829b3a9641e/sentry-ruby/lib/sentry/transport/http_transport.rb#L15)
- [ ] Node (TODO, see https://github.com/getsentry/develop/pull/1222#discussion_r1567465462)
- [ ] …add more SDKs to check here…
### (Optional) Adopt optional/additional format in SDKs
- [ ] https://github.com/getsentry/sentry-dart/issues/1901
- [ ] …add more SDKs to implement here…

Why should we be doing this?

To make troubleshooting of issues more viable if only the http request headers are available, e.g. in incidents like INC-648

Why now?

The earlier we add at least the basic info (SDK name+version), the higher the likelihood that we have useful information available during the next incident.

RFC

No response

Slack-Channel

#inc-648

Notion Document(s)

INC-648 doc

Stakeholder(s)

INC-648, SRE

Team(s)

Mobile Web Backend Web Frontend (?)

kahest commented 4 months ago

We'll align across SDK teams what the User Agent should look like

kahest commented 4 months ago

PHP, Go, Python do send a user agent, format is like <sdk-name>/<sdk-version>

kahest commented 4 months ago
  1. phase: all SDKs send <sdk-name>/<sdk-version>
    • most SDKs already use that format
    • some don’t set anything, some just set <sdk-name>
    • didn’t find an SDK using a different format
    • added tasks to align Mobile+adjacent SDKs, feel free to check your (Web) SDKs as well
  2. phase: align on (optional) additional OS/runtime info
    • don’t need an RFC (?)
    • goal: provide a guideline on how to add that info
    • e.g. something like <sdk-name>/<sdk-version> (<device-name> <device-model>; <os-name> <os-version>; <runtime-name> <runtime-version>)
    • SDKs can implement this on case-by-case basis
kahest commented 2 months ago

somewhat related initiative on Ingest team: https://github.com/getsentry/team-ingest/issues/276