From 659f89ace0878095cddff0775f9b179abb3ff5b7 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Wed, 17 Apr 2024 13:39:14 +0200 Subject: [PATCH 1/2] feat: add Linux distributions to the os context --- src/docs/sdk/event-payloads/contexts.mdx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/docs/sdk/event-payloads/contexts.mdx b/src/docs/sdk/event-payloads/contexts.mdx index 16a53e77b0..39e504ed23 100644 --- a/src/docs/sdk/event-payloads/contexts.mdx +++ b/src/docs/sdk/event-payloads/contexts.mdx @@ -273,6 +273,14 @@ output of the `uname` syscall. system. For some well-known runtimes, Sentry will attempt to parse `name` and `version` from this string, if they are not explicitly given. +`distribution` + +: _Optional_. An object that provides meta-data for Linux distributions. Contains the following keys: + +- `name`: A name that is stable for each distribution (examples: `ubuntu`, `rhel`, `alpine`). +- `version`: _Optional_. Typically identifies at least the major release version number. Distributions with rolling releases only, will not provide a version. +- `pretty_name`: _Optional_. Typically provides the full name, full version, and release alias (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`). + ### Example OS Context 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: "linux": { "type": "os", "name": "Linux", - "version": "5.10.6", - "build": "arch1-1" + "version": "6.1.82(99.168.amzn2023.x86_64)", + "distribution": { + "name": "amzn", + "version": "2023", + "pretty_name": "Amazon Linux 2023.4.20240401" + } } } ``` From 599b94b07821b107c6b288d4edddef275180d2e0 Mon Sep 17 00:00:00 2001 From: Mischan Toosarani-Hausberger Date: Mon, 22 Apr 2024 13:22:11 +0200 Subject: [PATCH 2/2] 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. --- src/docs/sdk/event-payloads/contexts.mdx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/docs/sdk/event-payloads/contexts.mdx b/src/docs/sdk/event-payloads/contexts.mdx index 39e504ed23..359b825ed2 100644 --- a/src/docs/sdk/event-payloads/contexts.mdx +++ b/src/docs/sdk/event-payloads/contexts.mdx @@ -275,11 +275,11 @@ system. For some well-known runtimes, Sentry will attempt to parse `name` and `distribution` -: _Optional_. An object that provides meta-data for Linux distributions. Contains the following keys: +: _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: -- `name`: A name that is stable for each distribution (examples: `ubuntu`, `rhel`, `alpine`). -- `version`: _Optional_. Typically identifies at least the major release version number. Distributions with rolling releases only, will not provide a version. -- `pretty_name`: _Optional_. Typically provides the full name, full version, and release alias (examples: `Ubuntu 22.04.4 LTS`, `Raspian GNU/Linux 10 (buster)`). +- `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). +- `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. +- `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)`). ### Example OS Context