summaryrefslogtreecommitdiffstats
path: root/database
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-07-18 18:41:37 +0300
committerGitHub <noreply@github.com>2023-07-18 18:41:37 +0300
commit7c2acb3b244aa93a37a3dcc71d14ee84c343f87b (patch)
tree530c5038a71d1219b49a19923373892e894837d4 /database
parente93a91e151a61263203b021f98b8429e7eeb8c21 (diff)
added missing fields to alerts instances (#15442)
Diffstat (limited to 'database')
-rw-r--r--database/contexts/api_v2.c9
-rw-r--r--database/contexts/rrdcontext.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/database/contexts/api_v2.c b/database/contexts/api_v2.c
index 4469e11614..ed7f955ada 100644
--- a/database/contexts/api_v2.c
+++ b/database/contexts/api_v2.c
@@ -346,6 +346,10 @@ static void alert_instances_v2_insert_callback(const DICTIONARY_ITEM *item __may
t->chart_name = rc->rrdset->name;
t->family = rc->rrdset->family;
t->units = rc->units;
+ t->classification = rc->classification;
+ t->type = rc->type;
+ t->recipient = rc->recipient;
+ t->component = rc->component;
t->name = rc->name;
t->source = rc->source;
t->status = rc->status;
@@ -1336,6 +1340,11 @@ static int contexts_v2_alert_instance_to_json_callback(const DICTIONARY_ITEM *it
buffer_json_member_add_uuid(wb, "cfg", &t->config_hash_id);
buffer_json_member_add_string(wb, "src", string2str(t->source));
+ buffer_json_member_add_string(wb, "to", string2str(t->recipient));
+ buffer_json_member_add_string(wb, "tp", string2str(t->type));
+ buffer_json_member_add_string(wb, "cm", string2str(t->component));
+ buffer_json_member_add_string(wb, "cl", string2str(t->classification));
+
// Agent specific fields
buffer_json_member_add_uint64(wb, "gi", t->global_id);
// rrdcalc_flags_to_json_array (wb, "flags", t->flags);
diff --git a/database/contexts/rrdcontext.h b/database/contexts/rrdcontext.h
index 68ab3c35ca..e3a1ab9afc 100644
--- a/database/contexts/rrdcontext.h
+++ b/database/contexts/rrdcontext.h
@@ -523,6 +523,10 @@ struct sql_alert_instance_v2_entry {
STRING *family;
STRING *units;
STRING *source;
+ STRING *classification;
+ STRING *type;
+ STRING *component;
+ STRING *recipient;
RRDCALC_STATUS status;
RRDCALC_FLAGS flags;
STRING *info;