mirror of
https://github.com/netdata/netdata.git
synced 2025-04-14 09:38:34 +00:00

* Setup sentry-native SDK. * Integrate Sentry into our CI Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * minor fix Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Include sentry field to the build matrix Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Update the bundle_sentry flag for all the distros Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * more changes Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * NON mergeable change Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * . Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Enable fetch content. * Abort in profile plugin * Update plugin_profile.cc * NON MERGABLE COMMIT, just for testing purposes * NON MERGEABLE CHANGE, jsut for testing purposes * Bump * Use breakpad backend * Multiple changes - Make DSN variable that we read from the CI from the CI - Upload debug symbols - Fix packaging workflow; include new env vars & fix shecllchecks Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Modify sentry dif command * fix merge conf Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Fix merge conflict * Undo file prefix map. * Fix typo * Cleanup stuff. * Add 256-checksum * Renable ML for debs * Finalize CI changes Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Update rules * final touches Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * merge the two if, no point to have them sep Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> * Update contrib/debian/rules Co-authored-by: Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com> * Update contrib/debian/rules Co-authored-by: Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com> * Add license * Enable sentry for debian 12. * Update .github/workflows/packaging.yml Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com> --------- Signed-off-by: Tasos Katsoulas <tasos@netdata.cloud> Co-authored-by: Tasos Katsoulas <tasos@netdata.cloud> Co-authored-by: Tasos Katsoulas <12612986+tkatsoulas@users.noreply.github.com> Co-authored-by: Austin S. Hemmelgarn <ahferroin7@gmail.com>
51 lines
1.4 KiB
C
51 lines
1.4 KiB
C
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "sentry-native.h"
|
|
#include "daemon/common.h"
|
|
|
|
#include "sentry.h"
|
|
|
|
static bool sentry_telemetry_disabled(void)
|
|
{
|
|
char path[FILENAME_MAX + 1];
|
|
sprintf(path, "%s/%s", netdata_configured_user_config_dir, ".opt-out-from-anonymous-statistics");
|
|
|
|
struct stat buffer;
|
|
bool opt_out_file_exists = (stat(path, &buffer) == 0);
|
|
|
|
if (opt_out_file_exists)
|
|
return true;
|
|
|
|
return getenv("DISABLE_TELEMETRY") != NULL;
|
|
}
|
|
|
|
void sentry_native_init(void)
|
|
{
|
|
if (sentry_telemetry_disabled())
|
|
return;
|
|
|
|
// path where sentry should save stuff
|
|
char path[FILENAME_MAX];
|
|
snprintfz(path, FILENAME_MAX - 1, "%s/%s", netdata_configured_cache_dir, ".sentry-native");
|
|
|
|
sentry_options_t *options = sentry_options_new();
|
|
sentry_options_set_dsn(options, NETDATA_SENTRY_DSN);
|
|
sentry_options_set_database_path(options, path);
|
|
sentry_options_set_auto_session_tracking(options, false);
|
|
sentry_options_set_environment(options, NETDATA_SENTRY_ENVIRONMENT);
|
|
sentry_options_set_release(options, NETDATA_SENTRY_RELEASE);
|
|
sentry_options_set_dist(options, NETDATA_SENTRY_DIST);
|
|
#ifdef NETDATA_INTERNAL_CHECKS
|
|
sentry_options_set_debug(options, 1);
|
|
#endif
|
|
|
|
sentry_init(options);
|
|
}
|
|
|
|
void sentry_native_fini(void)
|
|
{
|
|
if (sentry_telemetry_disabled())
|
|
return;
|
|
|
|
sentry_close();
|
|
}
|