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

Commit b2b11f7

Browse files
authored
feat: add Linux distributions to the os context (#1227)
* feat: add Linux distributions to the os context * Link to official docs and a list of distribution identifiers Also mention the /etc/os-release keys and how they map to the ones in the distribution object.
1 parent 47eebea commit b2b11f7

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/docs/sdk/event-payloads/contexts.mdx

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,6 +273,14 @@ output of the `uname` syscall.
273273
system. For some well-known runtimes, Sentry will attempt to parse `name` and
274274
`version` from this string, if they are not explicitly given.
275275

276+
`distribution`
277+
278+
: _Optional_. An object that provides meta-data for Linux distributions. The values correspond to entries from the [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#Options) configuration. Contains the following keys:
279+
280+
- `name`: A stable name for each distribution. This maps to `ID` in `/etc/os-release` (examples: `ubuntu`, `rhel`, `alpine`; a full list of tested identifiers is available in the [Native SDK repository](https://github.com/getsentry/sentry-native/blob/master/tests/fixtures/os_releases/distribution_names.txt).
281+
- `version`: _Optional_. Typically identifies at least the major release version number. This maps to `VERSION_ID` in `/etc/os-release`. Distributions with rolling releases only, will not provide a version.
282+
- `pretty_name`: _Optional_. Typically provides the full name, full version, and release alias. This maps to `PRETTY_NAME` in `/etc/os-release` (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`).
283+
276284
### Example OS Context
277285

278286
The OS Context for the 3 major OSs should look like this:
@@ -295,8 +303,12 @@ The OS Context for the 3 major OSs should look like this:
295303
"linux": {
296304
"type": "os",
297305
"name": "Linux",
298-
"version": "5.10.6",
299-
"build": "arch1-1"
306+
"version": "6.1.82(99.168.amzn2023.x86_64)",
307+
"distribution": {
308+
"name": "amzn",
309+
"version": "2023",
310+
"pretty_name": "Amazon Linux 2023.4.20240401"
311+
}
300312
}
301313
}
302314
```

0 commit comments

Comments
 (0)