@cryptotaxi247 / netdata-1 / commits / 20a43252b

Improve the update of the alert chart name in the database (#15490)

Disable check during health init Store chart_name when storing a new transition

Stelios Fragkakis committed Jul 22, 2023 at 01:01 UTC 20a43252be2ce8af9914ec14fc2ccef6c8c740e7
2 files changed +4 -3
database/sqlite/sqlite_health.c
+2 -1
@@ -85,7 +85,8 @@ failed:
85 #define SQL_INSERT_HEALTH_LOG "INSERT INTO health_log (host_id, alarm_id, " \
86 "config_hash_id, name, chart, family, exec, recipient, units, chart_context, last_transition_id, chart_name) " \
87 "VALUES (?,?,?,?,?,?,?,?,?,?,?,?) " \
88 - "ON CONFLICT (host_id, alarm_id) DO UPDATE SET last_transition_id = excluded.last_transition_id RETURNING health_log_id; "
88 + "ON CONFLICT (host_id, alarm_id) DO UPDATE SET last_transition_id = excluded.last_transition_id, " \
89 + "chart_name = excluded.chart_name RETURNING health_log_id; "
90
91 #define SQL_INSERT_HEALTH_LOG_DETAIL "INSERT INTO health_log_detail (health_log_id, unique_id, alarm_id, alarm_event_id, " \
92 "updated_by_id, updates_id, when_key, duration, non_clear_duration, flags, exec_run_timestamp, delay_up_to_timestamp, " \
health/health.c
+2 -2
@@ -844,8 +844,8 @@ static void initialize_health(RRDHOST *host)
844 host->health.health_default_exec = string_strdupz(config_get(CONFIG_SECTION_HEALTH, "script to execute on alarm", filename));
845 host->health.health_default_recipient = string_strdupz("root");
846
847 - if (!is_chart_name_populated(&host->host_uuid))
848 - chart_name_populate(&host->host_uuid);
847 + //if (!is_chart_name_populated(&host->host_uuid))
848 + // chart_name_populate(&host->host_uuid);
849
850 sql_health_alarm_log_load(host);
851