0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-15 01:58:34 +00:00

do not send sentry reports on rrd_init() failures ()

This commit is contained in:
Costa Tsaousis 2025-02-12 13:22:07 +00:00 committed by GitHub
parent fdeacfd8d9
commit 772cc5fff5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 1 deletions

View file

@ -12,6 +12,16 @@
#include "sentry-native/sentry-native.h"
#endif
static bool abort_on_fatal = true;
void abort_on_fatal_disable(void) {
abort_on_fatal = false;
}
void abort_on_fatal_enable(void) {
abort_on_fatal = true;
}
void web_client_cache_destroy(void);
extern struct netdata_static_thread *static_threads;
@ -296,7 +306,7 @@ void netdata_cleanup_and_exit(int ret, const char *action, const char *action_re
#endif
#ifdef ENABLE_SENTRY
if (ret) {
if (ret && abort_on_fatal) {
if (action_data) {
nd_sentry_add_breadcrumb(action_data);
}

View file

@ -7,4 +7,7 @@
void cancel_main_threads(void);
void abort_on_fatal_disable(void);
void abort_on_fatal_enable(void);
#endif //NETDATA_DAEMON_SHUTDOWN_H

View file

@ -959,10 +959,12 @@ int netdata_main(int argc, char **argv) {
delta_startup_time("initialize RRD structures");
abort_on_fatal_disable();
if(rrd_init(netdata_configured_hostname, system_info, false)) {
set_late_analytics_variables(system_info);
fatal("Cannot initialize localhost instance with name '%s'.", netdata_configured_hostname);
}
abort_on_fatal_enable();
delta_startup_time("check for incomplete shutdown");