@cryptotaxi247 / netdata-1 / commits / c0d1d167c

don't log too much about streaming connections (#14117)

Costa Tsaousis committed Dec 9, 2022 at 18:55 UTC c0d1d167c4108398400ea31a6bbf58e18d717132
3 files changed +13 -20
streaming/receiver.c
+1 -1
@@ -648,7 +648,7 @@ static int rrdpush_receive(struct receiver_state *rpt)
648 }
649 #endif
650
651 - info("STREAM %s [receive from [%s]:%s]: initializing communication...", rrdhost_hostname(rpt->host), rpt->client_ip, rpt->client_port);
651 + // info("STREAM %s [receive from [%s]:%s]: initializing communication...", rrdhost_hostname(rpt->host), rpt->client_ip, rpt->client_port);
652 char initial_response[HTTP_HEADER_SIZE];
653 if (stream_has_capability(rpt, STREAM_CAP_VCAPS)) {
654 log_receiver_capabilities(rpt);
streaming/rrdpush.c
+3 -12
@@ -496,20 +496,11 @@ int connect_to_one_of_destinations(
496 for (struct rrdpush_destinations *d = host->destinations; d; d = d->next) {
497 time_t now = now_realtime_sec();
498
499 - if(d->postpone_reconnection_until > now) {
500 - info(
501 - "STREAM %s: skipping destination '%s' (default port: %d) due to last error (code: %d, %s), will retry it in %d seconds",
502 - rrdhost_hostname(host),
503 - string2str(d->destination),
504 - default_port,
505 - d->last_handshake, d->last_error?d->last_error:"unset reason description",
506 - (int)(d->postpone_reconnection_until - now));
507 -
499 + if(d->postpone_reconnection_until > now)
500 continue;
509 - }
501
502 info(
512 - "STREAM %s: attempting to connect to '%s' (default port: %d)...",
503 + "STREAM %s: connecting to '%s' (default port: %d)...",
504 rrdhost_hostname(host),
505 string2str(d->destination),
506 default_port);
@@ -667,7 +658,7 @@ int rrdpush_receiver_too_busy_now(struct web_client *w) {
658
659 void *rrdpush_receiver_thread(void *ptr);
660 int rrdpush_receiver_thread_spawn(struct web_client *w, char *url) {
670 - info("clients wants to STREAM metrics.");
661 + // info("clients wants to STREAM metrics.");
662
663 char *key = NULL, *hostname = NULL, *registry_hostname = NULL, *machine_guid = NULL, *os = "unknown", *timezone = "unknown", *abbrev_timezone = "UTC", *tags = NULL;
664 int32_t utc_offset = 0;
streaming/sender.c
+9 -7
@@ -222,8 +222,6 @@ static void rrdpush_sender_thread_send_custom_host_variables(RRDHOST *host) {
222 // resets all the chart, so that their definitions
223 // will be resent to the central netdata
224 static void rrdpush_sender_thread_reset_all_charts(RRDHOST *host) {
225 - error("Clearing stream_collected_metrics flag in charts of host %s", rrdhost_hostname(host));
226 -
225 RRDSET *st;
226 rrdset_foreach_read(st, host) {
227 rrdset_flag_clear(st, RRDSET_FLAG_UPSTREAM_EXPOSED | RRDSET_FLAG_SENDER_REPLICATION_IN_PROGRESS);
@@ -418,13 +416,17 @@ static inline bool rrdpush_sender_validate_response(RRDHOST *host, struct sender
416 return true;
417 }
418
421 - error("STREAM %s [send to %s]: %s.", rrdhost_hostname(host), s->connected_to, error);
422 -
419 worker_is_busy(worker_job_id);
420 rrdpush_sender_thread_close_socket(host);
421 host->destination->last_error = error;
422 host->destination->last_handshake = version;
423 host->destination->postpone_reconnection_until = now_realtime_sec() + delay;
424 +
425 + char buf[LOG_DATE_LENGTH];
426 + log_date(buf, LOG_DATE_LENGTH, host->destination->postpone_reconnection_until);
427 + error("STREAM %s [send to %s]: %s - will retry in %ld secs, at %s",
428 + rrdhost_hostname(host), s->connected_to, error, delay, buf);
429 +
430 return false;
431 }
432
@@ -449,11 +451,11 @@ static bool rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_p
451 );
452
453 if(unlikely(s->rrdpush_sender_socket == -1)) {
452 - error("STREAM %s [send to %s]: could not connect to parent node at this time.", rrdhost_hostname(host), host->rrdpush_send_destination);
454 + // error("STREAM %s [send to %s]: could not connect to parent node at this time.", rrdhost_hostname(host), host->rrdpush_send_destination);
455 return false;
456 }
457
456 - info("STREAM %s [send to %s]: initializing communication...", rrdhost_hostname(host), s->connected_to);
458 + // info("STREAM %s [send to %s]: initializing communication...", rrdhost_hostname(host), s->connected_to);
459
460 #ifdef ENABLE_HTTPS
461 if(netdata_ssl_client_ctx){
@@ -657,7 +659,7 @@ static bool rrdpush_sender_thread_connect_to_parent(RRDHOST *host, int default_p
659 return false;
660 }
661
660 - info("STREAM %s [send to %s]: waiting response from remote netdata...", rrdhost_hostname(host), s->connected_to);
662 + // info("STREAM %s [send to %s]: waiting response from remote netdata...", rrdhost_hostname(host), s->connected_to);
663
664 bytes = recv_timeout(
665 #ifdef ENABLE_HTTPS