-
-
Notifications
You must be signed in to change notification settings - Fork 170
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Linux distro meta-data to OS context. #943
Comments
related: #467 (comment) |
Hi @tkatsoulas, can I ask you: would you want to use this for searching and filtering issues (requiring us to index the field in the backend and consider cardinality), or would it suffice as an additional data item that you look up per event? Thx! |
Hi @tkatsoulas, thanks. I expected that you want to be able to filter it; I just wanted to make sure. Changing the meaning of existing os-context properties is not a good idea: it would immediately split existing events from future events, which currently would appear in the same filter results. Some customers want to differentiate between broad OS categories (Win, macOS, Linux, etc.), and A new key (+ sub-keys?) for Linux distributions would be better, and we will talk about this internally with the ingest team about the right path. Please wait with any time investment on your part until this is clarified since this isn't solely a client SDK issue. |
Users of the Native SDK also want to search for the Linux distributions their events came from: getsentry/sentry-native#943 The corresponding PRs to * develop docs: getsentry/develop#1227 * relay: getsentry/relay#3443 * Native SDK: getsentry/sentry-native#963
Users of the Native SDK also want to search for the Linux distributions their events came from: getsentry/sentry-native#943 The corresponding PRs to * develop docs: getsentry/develop#1227 * relay: getsentry/relay#3443 * Native SDK: getsentry/sentry-native#963
One can also add Wine metadata to the context if the app is ran under that: {
// Add WINE version metadata if running under WINE
HMODULE hntdll;
typedef const char* (CDECL* wine_get_version_t)();
typedef const char* (CDECL* wine_get_build_id_t)();
typedef void (CDECL* wine_get_host_version_t)(const char** sysname, const char** release);
wine_get_version_t wine_get_version;
wine_get_build_id_t wine_get_build_id;
wine_get_host_version_t wine_get_host_version;
if ((hntdll = GetModuleHandleA("ntdll.dll")) && (wine_get_version = reinterpret_cast<wine_get_version_t>(GetProcAddress(hntdll, "wine_get_version"))))
{
sentry_value_t wine_ctx = sentry_value_new_object();
sentry_value_set_by_key(wine_ctx, "version", sentry_value_new_string(wine_get_version())); // example: 7.11
if (wine_get_build_id = reinterpret_cast<wine_get_build_id_t>(GetProcAddress(hntdll, "wine_get_build_id")))
sentry_value_set_by_key(wine_ctx, "build", sentry_value_new_string(wine_get_build_id())); // example: wine-7.11
if (wine_get_host_version = reinterpret_cast<wine_get_host_version_t>(GetProcAddress(hntdll, "wine_get_host_version")))
{
const char* sysname; // example: Linux
const char* release; // example: 5.16.20-2-MANJARO
wine_get_host_version(&sysname, &release);
sentry_value_set_by_key(wine_ctx, "sysname", sentry_value_new_string(sysname));
sentry_value_set_by_key(wine_ctx, "release", sentry_value_new_string(release));
}
sentry_set_context("wine", wine_ctx);
}
} |
The effort here is definitely not in the Native SDK but in everything behind that. This issue and related PRs are not fixed/released yet because there are still issues with the lookup of the new context format in clickhouse. Let's track this separately. |
Discussed in #942
Originally posted by tkatsoulas February 1, 2024
Hello guys,
The current implementation to understand the host OS https://github.com/getsentry/sentry-native/blob/master/src/sentry_os.c provides poor information for any distro. Are there any plans to update them? For instance
/etc/os-releases
file is there for most* of the Linux distros and can provide detailed information about a host. The current mechanisms can be used as a fallback.Thanks in advance,
Tasos.
CC: @kahest would be interesting if other SDKs already have a tag reserved for this information.
The text was updated successfully, but these errors were encountered: