summaryrefslogtreecommitdiffstats
path: root/exporting/send_data.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:50:01 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-07-20 04:50:01 +0000
commitcd4377fab21e0f500bef7f06543fa848a039c1e0 (patch)
treeba00a55e430c052d6bed0b61c0f8bbe8ebedd313 /exporting/send_data.c
parentReleasing debian version 1.40.1-1. (diff)
downloadnetdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.tar.xz
netdata-cd4377fab21e0f500bef7f06543fa848a039c1e0.zip
Merging upstream version 1.41.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'exporting/send_data.c')
-rw-r--r--exporting/send_data.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/exporting/send_data.c b/exporting/send_data.c
index d91fc50d7..3fec7320d 100644
--- a/exporting/send_data.c
+++ b/exporting/send_data.c
@@ -40,12 +40,11 @@ int exporting_discard_response(BUFFER *buffer, struct instance *instance) {
}
*d = '\0';
- debug(
- D_EXPORTING,
- "EXPORTING: received %zu bytes from %s connector instance. Ignoring them. Sample: '%s'",
- buffer_strlen(buffer),
- instance->config.name,
- sample);
+ netdata_log_debug(D_EXPORTING,
+ "EXPORTING: received %zu bytes from %s connector instance. Ignoring them. Sample: '%s'",
+ buffer_strlen(buffer),
+ instance->config.name,
+ sample);
#else
UNUSED(instance);
#endif /* NETDATA_INTERNAL_CHECKS */
@@ -96,14 +95,14 @@ void simple_connector_receive_response(int *sock, struct instance *instance)
stats->receptions++;
}
else if (r == 0) {
- error("EXPORTING: '%s' closed the socket", instance->config.destination);
+ netdata_log_error("EXPORTING: '%s' closed the socket", instance->config.destination);
close(*sock);
*sock = -1;
}
else {
// failed to receive data
if (errno != EAGAIN && errno != EWOULDBLOCK) {
- error("EXPORTING: cannot receive data from '%s'.", instance->config.destination);
+ netdata_log_error("EXPORTING: cannot receive data from '%s'.", instance->config.destination);
}
}
@@ -182,7 +181,7 @@ void simple_connector_send_buffer(
buffer_flush(buffer);
} else {
// oops! we couldn't send (all or some of the) data
- error(
+ netdata_log_error(
"EXPORTING: failed to write data to '%s'. Willing to write %zu bytes, wrote %zd bytes. Will re-connect.",
instance->config.destination,
buffer_len,
@@ -299,11 +298,11 @@ void simple_connector_worker(void *instance_p)
if (exporting_tls_is_enabled(instance->config.type, options) && sock != -1) {
if (netdata_ssl_exporting_ctx) {
if (sock_delnonblock(sock) < 0)
- error("Exporting cannot remove the non-blocking flag from socket %d", sock);
+ netdata_log_error("Exporting cannot remove the non-blocking flag from socket %d", sock);
if(netdata_ssl_open(&connector_specific_data->ssl, netdata_ssl_exporting_ctx, sock)) {
if(netdata_ssl_connect(&connector_specific_data->ssl)) {
- info("Exporting established a SSL connection.");
+ netdata_log_info("Exporting established a SSL connection.");
struct timeval tv;
tv.tv_sec = timeout.tv_sec / 4;
@@ -313,7 +312,7 @@ void simple_connector_worker(void *instance_p)
tv.tv_sec = 2;
if (setsockopt(sock, SOL_SOCKET, SO_RCVTIMEO, (const char *)&tv, sizeof(tv)))
- error("Cannot set timeout to socket %d, this can block communication", sock);
+ netdata_log_error("Cannot set timeout to socket %d, this can block communication", sock);
}
}
}
@@ -340,7 +339,7 @@ void simple_connector_worker(void *instance_p)
connector_specific_data->buffer,
buffered_metrics);
} else {
- error("EXPORTING: failed to update '%s'", instance->config.destination);
+ netdata_log_error("EXPORTING: failed to update '%s'", instance->config.destination);
stats->transmission_failures++;
// increment the counter we check for data loss