Skip to content

Commit ba07bb7

Browse files
feat(native): update contexts interface to flatten distribution keys (#11936)
* Updated distribution keys to flattened versions * link to native main branch + os-release dos * Change links to relevant Options entry
1 parent 7609dca commit ba07bb7

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

develop-docs/sdk/data-model/event-payloads/contexts.mdx

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -261,14 +261,17 @@ To summarize:
261261

262262
: _Optional_. An unprocessed description string obtained by the operating system. For some well-known runtimes, Sentry will attempt to parse `name` and `version` from this string, if they are not explicitly given.
263263

264-
`distribution`
264+
`distribution_name`
265265

266-
: _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:
266+
: _Optional_. A stable name for each distribution. This maps to `ID` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#ID=) (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))
267267

268+
`distribution_version`
268269

269-
- `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/feat/add_linux_distros_to_os_context/tests/fixtures/os_releases/distribution_names.txt).
270-
- `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.
271-
- `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)`).
270+
: _Optional_. Typically identifies at least the major release version number. This maps to `VERSION_ID` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#VERSION_ID=). Distributions with rolling releases only, will not provide a version.
271+
272+
`distribution_pretty_name`
273+
274+
: _Optional_. Typically provides the full name, full version, and release alias. This maps to `PRETTY_NAME` in [`/etc/os-release`](https://www.freedesktop.org/software/systemd/man/latest/os-release.html#PRETTY_NAME=) (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`).
272275

273276
### Example OS Context
274277

@@ -293,10 +296,9 @@ The OS Context for the 3 major OSs should look like this:
293296
"type": "os",
294297
"name": "Linux",
295298
"version": "6.1.82(99.168.amzn2023.x86_64)",
296-
"distribution": {
297-
"name": "amzn",
298-
"version": "2023",
299-
"pretty_name": "Amazon Linux 2023.4.20240401"
299+
"distribution_name": "amzn",
300+
"distribution_version": "2023",
301+
"distribution_pretty_name": "Amazon Linux 2023.4.20240401"
300302
}
301303
}
302304
}

0 commit comments

Comments
 (0)