summaryrefslogtreecommitdiffstats
path: root/health/health_log.c
diff options
context:
space:
mode:
authorEmmanuel Vasilakis <mrzammler@mm.st>2022-08-04 10:18:53 +0300
committerGitHub <noreply@github.com>2022-08-04 10:18:53 +0300
commit2fd2607475479bcb1e5d929f109ffd5537303bb7 (patch)
treeaf2d78ab77e0a7bcde089e28c67d59c01948e302 /health/health_log.c
parent5634e0fdd1c9241e3d31bd80dd3908b3ef4f10d7 (diff)
Send chart context with alert events to the cloud (#13409)
* add chart context to alert events * migrate health log tables to add chart_context * send it via proto message * add from v3 to v4 * free table * free chart_context
Diffstat (limited to 'health/health_log.c')
-rw-r--r--health/health_log.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/health/health_log.c b/health/health_log.c
index 7a4e12688a..f0a05531d3 100644
--- a/health/health_log.c
+++ b/health/health_log.c
@@ -450,6 +450,7 @@ inline ALARM_ENTRY* health_create_alarm_entry(
time_t when,
const char *name,
const char *chart,
+ const char *chart_context,
const char *family,
const char *class,
const char *component,
@@ -457,8 +458,8 @@ inline ALARM_ENTRY* health_create_alarm_entry(
const char *exec,
const char *recipient,
time_t duration,
- NETDATA_DOUBLE old_value,
- NETDATA_DOUBLE new_value,
+ NETDATA_DOUBLE old_value,
+ NETDATA_DOUBLE new_value,
RRDCALC_STATUS old_status,
RRDCALC_STATUS new_status,
const char *source,
@@ -478,6 +479,9 @@ inline ALARM_ENTRY* health_create_alarm_entry(
ae->hash_chart = simple_hash(ae->chart);
}
+ if(chart_context)
+ ae->chart_context = strdupz(chart_context);
+
uuid_copy(ae->config_hash_id, *((uuid_t *) config_hash_id));
if(family)
@@ -583,6 +587,7 @@ inline void health_alarm_log(
inline void health_alarm_log_free_one_nochecks_nounlink(ALARM_ENTRY *ae) {
freez(ae->name);
freez(ae->chart);
+ freez(ae->chart_context);
freez(ae->family);
freez(ae->classification);
freez(ae->component);