Only queue an alert to the cloud when it's inserted (#15110)
only queue an alert to cloud when its inserted
Emmanuel Vasilakis committed
May 29, 2023 at 23:11 UTC
bb835fe8eee4ed1b0f14b85a50578cadbc52dd53
3 files changed
+8
-9
database/sqlite/sqlite_aclk_alert.c
+1
-1
@@ -1046,7 +1046,7 @@ void aclk_push_alarm_checkpoint(RRDHOST *host __maybe_unused)
1046
1047
if (rrdhost_flag_check(host, RRDHOST_FLAG_ACLK_STREAM_ALERTS)) {
1048
//postpone checkpoint send
1049
- wc->alert_checkpoint_req++;
1049
+ wc->alert_checkpoint_req+=3;
1050
log_access("ACLK REQ [%s (N/A)]: ALERTS CHECKPOINT POSTPONED", rrdhost_hostname(host));
1051
return;
1052
}
database/sqlite/sqlite_health.c
+7
-1
@@ -354,8 +354,14 @@ void sql_health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae)
354
{
355
if (ae->flags & HEALTH_ENTRY_FLAG_SAVED)
356
sql_health_alarm_log_update(host, ae);
357
- else
357
+ else {
358
sql_health_alarm_log_insert(host, ae);
359
+#ifdef ENABLE_ACLK
360
+ if (netdata_cloud_setting) {
361
+ sql_queue_alarm_to_aclk(host, ae, 0);
362
+ }
363
+#endif
364
+ }
365
}
366
367
/* Health related SQL queries
health/health_log.c
-7
@@ -5,14 +5,7 @@
5
// ----------------------------------------------------------------------------
6
7
inline void health_alarm_log_save(RRDHOST *host, ALARM_ENTRY *ae) {
8
-
8
sql_health_alarm_log_save(host, ae);
10
-
11
-#ifdef ENABLE_ACLK
12
- if (netdata_cloud_setting) {
13
- sql_queue_alarm_to_aclk(host, ae, 0);
14
- }
15
-#endif
9
}
10
11
// ----------------------------------------------------------------------------