0
0
Fork 0
mirror of https://github.com/netdata/netdata.git synced 2025-04-16 18:37:50 +00:00

Add alert version to aclk-state ()

Add current alert version to aclk-state
This commit is contained in:
Stelios Fragkakis 2025-01-08 12:54:21 +02:00 committed by GitHub
parent 888c37ca9b
commit 1cb0ce4980
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 1 deletions

View file

@ -1124,6 +1124,8 @@ static void fill_alert_status_for_host_json(json_object *obj, RRDHOST *host)
tmp = json_object_new_int(wc->snapshot_count);
json_object_object_add(obj, "alert-snapshot-count", tmp);
tmp = json_object_new_int64(calculate_node_alert_version(wc->host));
json_object_object_add(obj, "alert-version", tmp);
}
static json_object *timestamp_to_json(const time_t *t)

View file

@ -763,7 +763,7 @@ done:
"SELECT SUM(version) FROM health_log hl, alert_version av" \
" WHERE hl.host_id = @host_uuid AND hl.health_log_id = av.health_log_id AND av.status <> -2"
static uint64_t calculate_node_alert_version(RRDHOST *host)
uint64_t calculate_node_alert_version(RRDHOST *host)
{
sqlite3_stmt *res = NULL;

View file

@ -14,5 +14,6 @@ void send_alert_snapshot_to_cloud(RRDHOST *host __maybe_unused);
void aclk_process_send_alarm_snapshot(char *node_id, char *claim_id, char *snapshot_uuid);
bool process_alert_pending_queue(RRDHOST *host);
void aclk_push_alert_events_for_all_hosts(void);
uint64_t calculate_node_alert_version(RRDHOST *host);
#endif //NETDATA_SQLITE_ACLK_ALERT_H