diff options
author | Costa Tsaousis <costa@netdata.cloud> | 2023-06-28 23:14:10 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-28 23:14:10 +0300 |
commit | 5be9be74854d00879e6d52d6432ae12b5e8558cd (patch) | |
tree | 7d2c3e28db5aa1306cc480a45f1bfdd17b3c8375 /health/health.h | |
parent | 26ec3b119efb9271f622047259866a6083ed6269 (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 'health/health.h')
-rw-r--r-- | health/health.h | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/health/health.h b/health/health.h index 8b967c197b..2767ddc233 100644 --- a/health/health.h +++ b/health/health.h @@ -7,18 +7,21 @@ extern unsigned int default_health_enabled; -#define HEALTH_ENTRY_FLAG_PROCESSED 0x00000001 -#define HEALTH_ENTRY_FLAG_UPDATED 0x00000002 -#define HEALTH_ENTRY_FLAG_EXEC_RUN 0x00000004 -#define HEALTH_ENTRY_FLAG_EXEC_FAILED 0x00000008 -#define HEALTH_ENTRY_FLAG_SILENCED 0x00000010 -#define HEALTH_ENTRY_RUN_ONCE 0x00000020 -#define HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS 0x00000040 -#define HEALTH_ENTRY_FLAG_IS_REPEATING 0x00000080 - -#define HEALTH_ENTRY_FLAG_SAVED 0x10000000 -#define HEALTH_ENTRY_FLAG_ACLK_QUEUED 0x20000000 -#define HEALTH_ENTRY_FLAG_NO_CLEAR_NOTIFICATION 0x80000000 +typedef enum __attribute__((packed)) { + HEALTH_ENTRY_FLAG_PROCESSED = 0x00000001, + HEALTH_ENTRY_FLAG_UPDATED = 0x00000002, + HEALTH_ENTRY_FLAG_EXEC_RUN = 0x00000004, + HEALTH_ENTRY_FLAG_EXEC_FAILED = 0x00000008, + HEALTH_ENTRY_FLAG_SILENCED = 0x00000010, + HEALTH_ENTRY_RUN_ONCE = 0x00000020, + HEALTH_ENTRY_FLAG_EXEC_IN_PROGRESS = 0x00000040, + HEALTH_ENTRY_FLAG_IS_REPEATING = 0x00000080, + HEALTH_ENTRY_FLAG_SAVED = 0x10000000, + HEALTH_ENTRY_FLAG_ACLK_QUEUED = 0x20000000, + HEALTH_ENTRY_FLAG_NO_CLEAR_NOTIFICATION = 0x80000000, +} HEALTH_ENTRY_FLAGS; + +void health_entry_flags_to_json_array(BUFFER *wb, const char *key, HEALTH_ENTRY_FLAGS flags); #ifndef HEALTH_LISTEN_PORT #define HEALTH_LISTEN_PORT 19998 @@ -40,8 +43,7 @@ void health_reload(void); void health_aggregate_alarms(RRDHOST *host, BUFFER *wb, BUFFER* context, RRDCALC_STATUS status); void health_alarms2json(RRDHOST *host, BUFFER *wb, int all); -void health_alert2json(RRDHOST *host, BUFFER *wb, ALERT_OPTIONS all, Pvoid_t JudyHS, time_t after, time_t before, uint32_t top); -void health_alert2json_conf(RRDHOST *host, BUFFER *wb, ALERT_OPTIONS all); +void health_alert2json_conf(RRDHOST *host, BUFFER *wb, CONTEXTS_V2_OPTIONS all); void health_alarms_values2json(RRDHOST *host, BUFFER *wb, int all); void health_api_v1_chart_variables2json(RRDSET *st, BUFFER *buf); @@ -75,7 +77,7 @@ ALARM_ENTRY* health_create_alarm_entry( STRING *units, STRING *info, int delay, - uint32_t flags); + HEALTH_ENTRY_FLAGS flags); void health_alarm_log_add_entry(RRDHOST *host, ALARM_ENTRY *ae); |