summaryrefslogtreecommitdiffstats
path: root/exporting
diff options
context:
space:
mode:
authorCosta Tsaousis <costa@netdata.cloud>2022-09-07 15:28:30 +0300
committerGitHub <noreply@github.com>2022-09-07 15:28:30 +0300
commit3f6a75250d8251b0142248ed2f33f7d857ee21c8 (patch)
treef8fd7544a2fb509b295e6bd5267baab6014bc787 /exporting
parent17e0676b5bb6b11ad9aec705ade05163dcc2de31 (diff)
Obsolete RRDSET state (#13635)
* move chart_labels to rrdset * rename chart_labels to rrdlabels * renamed hash_id to uuid * turned is_ar_chart into an rrdset flag * removed rrdset state * removed unused senders_connected member of rrdhost * removed unused host flag RRDHOST_FLAG_MULTIHOST * renamed rrdhost host_labels to rrdlabels * Update exporting unit tests Co-authored-by: Vladimir Kobal <vlad@prokk.net>
Diffstat (limited to 'exporting')
-rw-r--r--exporting/check_filters.c2
-rw-r--r--exporting/graphite/graphite.c2
-rw-r--r--exporting/json/json.c2
-rw-r--r--exporting/opentsdb/opentsdb.c4
-rw-r--r--exporting/prometheus/prometheus.c4
-rw-r--r--exporting/prometheus/remote_write/remote_write.c2
-rw-r--r--exporting/tests/exporting_fixtures.c8
7 files changed, 12 insertions, 12 deletions
diff --git a/exporting/check_filters.c b/exporting/check_filters.c
index b07ec07b17..19614d3253 100644
--- a/exporting/check_filters.c
+++ b/exporting/check_filters.c
@@ -56,7 +56,7 @@ int rrdset_is_exportable(struct instance *instance, RRDSET *st)
#endif
// Do not export anomaly rates charts.
- if (st->state && st->state->is_ar_chart)
+ if (rrdset_is_ar_chart(st))
return 0;
if (st->exporting_flags == NULL)
diff --git a/exporting/graphite/graphite.c b/exporting/graphite/graphite.c
index 6375ec2094..8753545578 100644
--- a/exporting/graphite/graphite.c
+++ b/exporting/graphite/graphite.c
@@ -101,7 +101,7 @@ int format_host_labels_graphite_plaintext(struct instance *instance, RRDHOST *ho
if (unlikely(!sending_labels_configured(instance)))
return 0;
- rrdlabels_to_buffer(host->host_labels, instance->labels_buffer, ";", "=", "", "",
+ rrdlabels_to_buffer(host->rrdlabels, instance->labels_buffer, ";", "=", "", "",
exporting_labels_filter_callback, instance,
NULL, sanitize_graphite_label_value);
diff --git a/exporting/json/json.c b/exporting/json/json.c
index 627b8208e7..06100ba5e2 100644
--- a/exporting/json/json.c
+++ b/exporting/json/json.c
@@ -125,7 +125,7 @@ int format_host_labels_json_plaintext(struct instance *instance, RRDHOST *host)
return 0;
buffer_strcat(instance->labels_buffer, "\"labels\":{");
- rrdlabels_to_buffer(host->host_labels, instance->labels_buffer, "", ":", "\"", ",",
+ rrdlabels_to_buffer(host->rrdlabels, instance->labels_buffer, "", ":", "\"", ",",
exporting_labels_filter_callback, instance,
NULL, sanitize_json_string);
buffer_strcat(instance->labels_buffer, "},");
diff --git a/exporting/opentsdb/opentsdb.c b/exporting/opentsdb/opentsdb.c
index ed56e3d253..d77a2f6a5b 100644
--- a/exporting/opentsdb/opentsdb.c
+++ b/exporting/opentsdb/opentsdb.c
@@ -156,7 +156,7 @@ int format_host_labels_opentsdb_telnet(struct instance *instance, RRDHOST *host)
return 0;
buffer_strcat(instance->labels_buffer, " ");
- rrdlabels_to_buffer(host->host_labels, instance->labels_buffer, "", "=", "", " ",
+ rrdlabels_to_buffer(host->rrdlabels, instance->labels_buffer, "", "=", "", " ",
exporting_labels_filter_callback, instance,
NULL, sanitize_opentsdb_label_value);
return 0;
@@ -288,7 +288,7 @@ int format_host_labels_opentsdb_http(struct instance *instance, RRDHOST *host) {
if (unlikely(!sending_labels_configured(instance)))
return 0;
- rrdlabels_to_buffer(host->host_labels, instance->labels_buffer, ",", ":", "\"", "",
+ rrdlabels_to_buffer(host->rrdlabels, instance->labels_buffer, ",", ":", "\"", "",
exporting_labels_filter_callback, instance,
NULL, sanitize_opentsdb_label_value);
return 0;
diff --git a/exporting/prometheus/prometheus.c b/exporting/prometheus/prometheus.c
index 560022b72f..26c0811d6f 100644
--- a/exporting/prometheus/prometheus.c
+++ b/exporting/prometheus/prometheus.c
@@ -29,7 +29,7 @@ inline int can_send_rrdset(struct instance *instance, RRDSET *st, SIMPLE_PATTERN
#endif
// Do not send anomaly rates charts.
- if (st->state && st->state->is_ar_chart)
+ if (rrdset_is_ar_chart(st))
return 0;
if (unlikely(rrdset_flag_check(st, RRDSET_FLAG_EXPORTING_IGNORE)))
@@ -327,7 +327,7 @@ void format_host_labels_prometheus(struct instance *instance, RRDHOST *host)
.instance = instance,
.count = 0
};
- rrdlabels_walkthrough_read(host->host_labels, format_prometheus_label_callback, &tmp);
+ rrdlabels_walkthrough_read(host->rrdlabels, format_prometheus_label_callback, &tmp);
}
struct host_variables_callback_options {
diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c
index 29215283e8..ad337513eb 100644
--- a/exporting/prometheus/remote_write/remote_write.c
+++ b/exporting/prometheus/remote_write/remote_write.c
@@ -183,7 +183,7 @@ int format_host_prometheus_remote_write(struct instance *instance, RRDHOST *host
.write_request = connector_specific_data->write_request,
.instance = instance
};
- rrdlabels_walkthrough_read(host->host_labels, format_remote_write_label_callback, &tmp);
+ rrdlabels_walkthrough_read(host->rrdlabels, format_remote_write_label_callback, &tmp);
}
return 0;
diff --git a/exporting/tests/exporting_fixtures.c b/exporting/tests/exporting_fixtures.c
index da48e424be..906c7cf892 100644
--- a/exporting/tests/exporting_fixtures.c
+++ b/exporting/tests/exporting_fixtures.c
@@ -41,9 +41,9 @@ int setup_rrdhost()
localhost->tags = string_strdupz("TAG1=VALUE1 TAG2=VALUE2");
- localhost->host_labels = rrdlabels_create();
- rrdlabels_add(localhost->host_labels, "key1", "value1", RRDLABEL_SRC_CONFIG);
- rrdlabels_add(localhost->host_labels, "key2", "value2", RRDLABEL_SRC_CONFIG);
+ localhost->rrdlabels = rrdlabels_create();
+ rrdlabels_add(localhost->rrdlabels, "key1", "value1", RRDLABEL_SRC_CONFIG);
+ rrdlabels_add(localhost->rrdlabels, "key2", "value2", RRDLABEL_SRC_CONFIG);
localhost->rrdset_root = calloc(1, sizeof(RRDSET));
RRDSET *st = localhost->rrdset_root;
@@ -86,7 +86,7 @@ int teardown_rrdhost()
string_freez(st->name);
free(st);
- rrdlabels_destroy(localhost->host_labels);
+ rrdlabels_destroy(localhost->rrdlabels);
string_freez(localhost->tags);
free(localhost);