From 7877a98bd9c00db5e81dd2f8c734cba2bab20be7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 12 Aug 2022 09:26:17 +0200 Subject: Merging upstream version 1.36.0. Signed-off-by: Daniel Baumann --- exporting/exporting_engine.h | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'exporting/exporting_engine.h') diff --git a/exporting/exporting_engine.h b/exporting/exporting_engine.h index 20f260c15..2141caa41 100644 --- a/exporting/exporting_engine.h +++ b/exporting/exporting_engine.h @@ -4,7 +4,6 @@ #define NETDATA_EXPORTING_ENGINE_H 1 #include "daemon/common.h" - #include #define exporter_get(section, name, value) expconfig_get(&exporting_config, section, name, value) @@ -27,7 +26,8 @@ typedef enum exporting_options { EXPORTING_OPTION_SEND_AUTOMATIC_LABELS = (1 << 4), EXPORTING_OPTION_USE_TLS = (1 << 5), - EXPORTING_OPTION_SEND_NAMES = (1 << 16) + EXPORTING_OPTION_SEND_NAMES = (1 << 16), + EXPORTING_OPTION_SEND_VARIABLES = (1 << 17) } EXPORTING_OPTIONS; #define EXPORTING_OPTIONS_SOURCE_BITS \ @@ -40,11 +40,13 @@ extern const char *global_exporting_prefix; #define sending_labels_configured(instance) \ (instance->config.options & (EXPORTING_OPTION_SEND_CONFIGURED_LABELS | EXPORTING_OPTION_SEND_AUTOMATIC_LABELS)) -#define should_send_label(instance, label) \ +#define should_send_label(instance, label_source) \ ((instance->config.options & EXPORTING_OPTION_SEND_CONFIGURED_LABELS && \ - label->label_source == LABEL_SOURCE_NETDATA_CONF) || \ + label_source & RRDLABEL_SRC_CONFIG) || \ (instance->config.options & EXPORTING_OPTION_SEND_AUTOMATIC_LABELS && \ - label->label_source != LABEL_SOURCE_NETDATA_CONF)) + label_source & RRDLABEL_SRC_AUTO)) + +#define should_send_variables(instance) (instance->config.options & EXPORTING_OPTION_SEND_VARIABLES) typedef enum exporting_connector_types { EXPORTING_CONNECTOR_TYPE_UNKNOWN, // Invalid type @@ -205,7 +207,7 @@ struct instance { int skip_host; int skip_chart; - BUFFER *labels; + BUFFER *labels_buffer; time_t after; time_t before; @@ -220,6 +222,7 @@ struct instance { int (*start_chart_formatting)(struct instance *instance, RRDSET *st); int (*metric_formatting)(struct instance *instance, RRDDIM *rd); int (*end_chart_formatting)(struct instance *instance, RRDSET *st); + int (*variables_formatting)(struct instance *instance, RRDHOST *host); int (*end_host_formatting)(struct instance *instance, RRDHOST *host); int (*end_batch_formatting)(struct instance *instance); @@ -270,7 +273,8 @@ int rrdset_is_exportable(struct instance *instance, RRDSET *st); extern EXPORTING_OPTIONS exporting_parse_data_source(const char *source, EXPORTING_OPTIONS exporting_options); -calculated_number exporting_calculate_value_from_stored_data( +NETDATA_DOUBLE +exporting_calculate_value_from_stored_data( struct instance *instance, RRDDIM *rd, time_t *last_timestamp); @@ -280,6 +284,7 @@ void start_host_formatting(struct engine *engine, RRDHOST *host); void start_chart_formatting(struct engine *engine, RRDSET *st); void metric_formatting(struct engine *engine, RRDDIM *rd); void end_chart_formatting(struct engine *engine, RRDSET *st); +void variables_formatting(struct engine *engine, RRDHOST *host); void end_host_formatting(struct engine *engine, RRDHOST *host); void end_batch_formatting(struct engine *engine); int flush_host_labels(struct instance *instance, RRDHOST *host); -- cgit v1.2.3