From 1b0f6c6b2296dc082d85f38c298a61442dcf2490 Mon Sep 17 00:00:00 2001 From: Costa Tsaousis Date: Mon, 13 Jun 2022 20:35:45 +0300 Subject: Labels with dictionary (#13070) * squashed and rebased to master * fix overflow and single character bug in sanitize; include rrd.h instead of node_info.h * added unittest for UTF-8 multibyte sanitization * Fix unit test compilation * Fix CMake build * remove double sanitizer for opentsdb; cleanup sanitize_json_string() * rename error_description to error_message to avoid conflict with json-c * revert last and undef error_description from json-c * more unittests; attempt to fix protobuf map issue * get rid of rrdlabels_get() and replace it with a safe version that writes the value to a buffer * added dictionary sorting unittest; rrdlabels_to_buffer() now is sorted * better sorted dictionary checking * proper unittesting for sorted dictionaries * call dictionary deletion callback when destroying the dictionary * remove obsolete variable * Fix exporting unit tests * Fix k8s label parsing test * workaround for cmocka and strdupz() * Bypass cmocka memory allocation check * Revert "Bypass cmocka memory allocation check" This reverts commit 4c49923839d9229bea23ca914dd8a0be1ebe2bf4. * Revert "workaround for cmocka and strdupz()" This reverts commit 7bebee04801db1865c748a7896d5fa54bb7104a5. * Bypass cmocka memory allocation checks * respect json formatting for chart labels * cloud sends colons * print the value only once * allow parenthesis in values and spaces; make stream sender send quotes for values Co-authored-by: Vladimir Kobal --- parser/parser.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'parser') diff --git a/parser/parser.h b/parser/parser.h index 65a4e1ab30..4860462d76 100644 --- a/parser/parser.h +++ b/parser/parser.h @@ -29,10 +29,10 @@ typedef struct pluginsd_action { PARSER_RC (*flush_action)(void *user, RRDSET *st); PARSER_RC (*disable_action)(void *user); PARSER_RC (*variable_action)(void *user, RRDHOST *host, RRDSET *st, char *name, int global, calculated_number value); - PARSER_RC (*label_action)(void *user, char *key, char *value, LABEL_SOURCE source); - PARSER_RC (*overwrite_action)(void *user, RRDHOST *host, struct label *new_labels); - PARSER_RC (*clabel_action)(void *user, char *key, char *value, LABEL_SOURCE source); - PARSER_RC (*clabel_commit_action)(void *user, RRDHOST *host, struct label *new_labels); + PARSER_RC (*label_action)(void *user, char *key, char *value, RRDLABEL_SRC source); + PARSER_RC (*overwrite_action)(void *user, RRDHOST *host, DICTIONARY *new_labels); + PARSER_RC (*clabel_action)(void *user, char *key, char *value, RRDLABEL_SRC source); + PARSER_RC (*clabel_commit_action)(void *user, RRDHOST *host, DICTIONARY *new_labels); PARSER_RC (*guid_action)(void *user, uuid_t *uuid); PARSER_RC (*context_action)(void *user, uuid_t *uuid); -- cgit v1.2.3