diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:49:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2023-07-20 04:49:55 +0000 |
commit | ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb (patch) | |
tree | 7a900833aad3ccc685712c6c2a7d87576d54f427 /exporting/prometheus/remote_write | |
parent | Adding upstream version 1.40.1. (diff) | |
download | netdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.tar.xz netdata-ab1bb5b7f1c3c3a7b240ab7fc8661459ecd7decb.zip |
Adding upstream version 1.41.0.upstream/1.41.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exporting/prometheus/remote_write')
-rw-r--r-- | exporting/prometheus/remote_write/remote_write.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/exporting/prometheus/remote_write/remote_write.c b/exporting/prometheus/remote_write/remote_write.c index 660b798e4..2b53b1c20 100644 --- a/exporting/prometheus/remote_write/remote_write.c +++ b/exporting/prometheus/remote_write/remote_write.c @@ -234,7 +234,7 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * struct prometheus_remote_write_specific_data *connector_specific_data = (struct prometheus_remote_write_specific_data *)simple_connector_data->connector_specific_data; - if (rd->collections_counter && !rrddim_flag_check(rd, RRDDIM_FLAG_OBSOLETE)) { + if (rd->collector.counter && !rrddim_flag_check(rd, RRDDIM_FLAG_OBSOLETE)) { char name[PROMETHEUS_LABELS_MAX + 1]; char dimension[PROMETHEUS_ELEMENT_MAX + 1]; char *suffix = ""; @@ -243,14 +243,14 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * if (as_collected) { // we need as-collected / raw data - if (unlikely(rd->last_collected_time.tv_sec < instance->after)) { - debug( + if (unlikely(rd->collector.last_collected_time.tv_sec < instance->after)) { + netdata_log_debug( D_EXPORTING, "EXPORTING: not sending dimension '%s' of chart '%s' from host '%s', " "its last data collection (%lu) is not within our timeframe (%lu to %lu)", rrddim_id(rd), rrdset_id(rd->rrdset), (host == localhost) ? instance->config.hostname : rrdhost_hostname(host), - (unsigned long)rd->last_collected_time.tv_sec, + (unsigned long)rd->collector.last_collected_time.tv_sec, (unsigned long)instance->after, (unsigned long)instance->before); return 0; @@ -272,10 +272,10 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * snprintf(name, PROMETHEUS_LABELS_MAX, "%s_%s%s", instance->config.prefix, context, suffix); add_metric( - connector_specific_data->write_request, - name, chart, family, dimension, + connector_specific_data->write_request, + name, chart, family, dimension, (host == localhost) ? instance->config.hostname : rrdhost_hostname(host), - rd->last_collected_value, timeval_msec(&rd->last_collected_time)); + rd->collector.last_collected_value, timeval_msec(&rd->collector.last_collected_time)); } else { // the dimensions of the chart, do not have the same algorithm, multiplier or divisor // we create a metric per dimension @@ -289,10 +289,10 @@ int format_dimension_prometheus_remote_write(struct instance *instance, RRDDIM * suffix); add_metric( - connector_specific_data->write_request, - name, chart, family, NULL, + connector_specific_data->write_request, + name, chart, family, NULL, (host == localhost) ? instance->config.hostname : rrdhost_hostname(host), - rd->last_collected_value, timeval_msec(&rd->last_collected_time)); + rd->collector.last_collected_value, timeval_msec(&rd->collector.last_collected_time)); } } else { // we need average or sum of the data @@ -386,7 +386,7 @@ int format_batch_prometheus_remote_write(struct instance *instance) size_t data_size = get_write_request_size(connector_specific_data->write_request); if (unlikely(!data_size)) { - error("EXPORTING: write request size is out of range"); + netdata_log_error("EXPORTING: write request size is out of range"); return 1; } @@ -394,7 +394,7 @@ int format_batch_prometheus_remote_write(struct instance *instance) buffer_need_bytes(buffer, data_size); if (unlikely(pack_and_clear_write_request(connector_specific_data->write_request, buffer->buffer, &data_size))) { - error("EXPORTING: cannot pack write request"); + netdata_log_error("EXPORTING: cannot pack write request"); return 1; } buffer->len = data_size; |