summaryrefslogtreecommitdiffstats
path: root/libnetdata
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2023-06-28 23:14:10 +0300
committerGitHub <noreply@github.com>2023-06-28 23:14:10 +0300
commit5be9be74854d00879e6d52d6432ae12b5e8558cd (patch)
tree7d2c3e28db5aa1306cc480a45f1bfdd17b3c8375 /libnetdata
parent26ec3b119efb9271f622047259866a6083ed6269 (diff)
rewrite /api/v2/alerts (#15257)
* rewrite /api/v2/alerts * implement searching for transition * Find transition id and issue callback * Fix parameters * call and transition filter * Search with transition as well * renames and cleanup * render flags * what if scenario for moving transitions at the top level * If transition is given, limit the query appropriately * Add alert transitions * Optimize find transition to use prepared query Drop temp table properly * enabled alert instances again * Order by when key * Order by global_id * Return last X transitions * updated field names * add ati to configurations and show all keys in debug mode * Code cleanup and optimizations * Drop temp table in case of error * Finalize temp table population statement to prevent memory leak * final changes --------- Co-authored-by: Stelios Fragkakis <52996999+stelfrag@users.noreply.github.com>
Diffstat (limited to 'libnetdata')
-rw-r--r--libnetdata/buffer/buffer.h2
-rw-r--r--libnetdata/eval/eval.c7
2 files changed, 8 insertions, 1 deletions
diff --git a/libnetdata/buffer/buffer.h b/libnetdata/buffer/buffer.h
index 5aaa26a079..17a7b378c1 100644
--- a/libnetdata/buffer/buffer.h
+++ b/libnetdata/buffer/buffer.h
@@ -757,7 +757,7 @@ static inline void buffer_json_member_add_uuid(BUFFER *wb, const char *key, uuid
buffer_print_json_key(wb, key);
buffer_fast_strcat(wb, ":", 1);
- if(value) {
+ if(value && !uuid_is_null(*value)) {
char uuid[GUID_LEN + 1];
uuid_unparse_lower(*value, uuid);
buffer_json_add_string_value(wb, uuid);
diff --git a/libnetdata/eval/eval.c b/libnetdata/eval/eval.c
index c7570bd2f9..6bf206febe 100644
--- a/libnetdata/eval/eval.c
+++ b/libnetdata/eval/eval.c
@@ -213,6 +213,13 @@ static inline NETDATA_DOUBLE eval_value(EVAL_EXPRESSION *exp, EVAL_VALUE *v, int
break;
}
+ if(likely(!*error)) {
+ if(unlikely(isnan(n)))
+ *error = EVAL_ERROR_VALUE_IS_NAN;
+ else if(unlikely(isinf(n)))
+ *error = EVAL_ERROR_VALUE_IS_INFINITE;
+ }
+
return n;
}