diff options
Diffstat (limited to 'src/mongo/db/free_mon/free_mon_processor.cpp')
-rw-r--r-- | src/mongo/db/free_mon/free_mon_processor.cpp | 47 |
1 files changed, 31 insertions, 16 deletions
diff --git a/src/mongo/db/free_mon/free_mon_processor.cpp b/src/mongo/db/free_mon/free_mon_processor.cpp index 8cb57bda42f..469488ba029 100644 --- a/src/mongo/db/free_mon/free_mon_processor.cpp +++ b/src/mongo/db/free_mon/free_mon_processor.cpp @@ -46,6 +46,7 @@ #include "mongo/db/free_mon/free_mon_storage.h" #include "mongo/db/service_context.h" #include "mongo/idl/idl_parser.h" +#include "mongo/logv2/log.h" #include "mongo/util/assert_util.h" #include "mongo/util/log.h" @@ -259,9 +260,11 @@ void FreeMonProcessor::run() { // Stop the queue _queue.stop(); - warning() << "Uncaught exception in '" << exceptionToStatus() - << "' in free monitoring subsystem. Shutting down the " - "free monitoring subsystem."; + LOGV2_WARNING(20619, + "Uncaught exception in '{exceptionToStatus}' in free monitoring subsystem. " + "Shutting down the " + "free monitoring subsystem.", + "exceptionToStatus"_attr = exceptionToStatus()); } } @@ -600,7 +603,7 @@ void FreeMonProcessor::doAsyncRegisterComplete( Status s = validateRegistrationResponse(resp); if (!s.isOK()) { - warning() << "Free Monitoring registration halted due to " << s; + LOGV2_WARNING(20620, "Free Monitoring registration halted due to {s}", "s"_attr = s); // Disable on any error _state->setState(StorageStateEnum::disabled); @@ -646,7 +649,9 @@ void FreeMonProcessor::doAsyncRegisterComplete( // Notify waiters notifyPendingRegisters(Status::OK()); - log() << "Free Monitoring is Enabled. Frequency: " << resp.getReportingInterval() << " seconds"; + LOGV2(20615, + "Free Monitoring is Enabled. Frequency: {resp_getReportingInterval} seconds", + "resp_getReportingInterval"_attr = resp.getReportingInterval()); // Enqueue next metrics upload immediately to deliver a good experience enqueue(FreeMonMessage::createNow(FreeMonMessageType::MetricsSend)); @@ -666,12 +671,16 @@ void FreeMonProcessor::doAsyncRegisterFail( if (!_registrationRetry->incrementError()) { // We have exceeded our retry - warning() << "Free Monitoring is abandoning registration after excess retries"; + LOGV2_WARNING(20621, "Free Monitoring is abandoning registration after excess retries"); return; } - LOG(1) << "Free Monitoring Registration Failed with status '" << msg->getPayload() - << "', retrying in " << _registrationRetry->getNextDuration(); + LOGV2_DEBUG(20616, + 1, + "Free Monitoring Registration Failed with status '{msg_getPayload}', retrying in " + "{registrationRetry_getNextDuration}", + "msg_getPayload"_attr = msg->getPayload(), + "registrationRetry_getNextDuration"_attr = _registrationRetry->getNextDuration()); // Enqueue a register retry enqueue(FreeMonRegisterCommandMessage::createWithDeadline( @@ -688,7 +697,7 @@ void FreeMonProcessor::doCommandUnregister( writeState(client); - log() << "Free Monitoring is Disabled"; + LOGV2(20617, "Free Monitoring is Disabled"); msg->setStatus(Status::OK()); } @@ -778,7 +787,7 @@ void FreeMonProcessor::doAsyncMetricsComplete( Status s = validateMetricsResponse(resp); if (!s.isOK()) { - warning() << "Free Monitoring metrics uploading halted due to " << s; + LOGV2_WARNING(20622, "Free Monitoring metrics uploading halted due to {s}", "s"_attr = s); // Disable free monitoring on validation errors _state->setState(StorageStateEnum::disabled); @@ -851,12 +860,16 @@ void FreeMonProcessor::doAsyncMetricsFail( if (!_metricsRetry->incrementError()) { // We have exceeded our retry - warning() << "Free Monitoring is abandoning metrics upload after excess retries"; + LOGV2_WARNING(20623, "Free Monitoring is abandoning metrics upload after excess retries"); return; } - LOG(1) << "Free Monitoring Metrics upload failed with status " << msg->getPayload() - << ", retrying in " << _metricsRetry->getNextDuration(); + LOGV2_DEBUG(20618, + 1, + "Free Monitoring Metrics upload failed with status {msg_getPayload}, retrying in " + "{metricsRetry_getNextDuration}", + "msg_getPayload"_attr = msg->getPayload(), + "metricsRetry_getNextDuration"_attr = _metricsRetry->getNextDuration()); // Enqueue next metrics upload enqueue(FreeMonMessage::createWithDeadline(FreeMonMessageType::MetricsSend, @@ -948,9 +961,11 @@ void FreeMonProcessor::doNotifyOnUpsert( // Stop the queue _queue.stop(); - warning() << "Uncaught exception in '" << exceptionToStatus() - << "' in free monitoring op observer. Shutting down the " - "free monitoring subsystem."; + LOGV2_WARNING(20624, + "Uncaught exception in '{exceptionToStatus}' in free monitoring op observer. " + "Shutting down the " + "free monitoring subsystem.", + "exceptionToStatus"_attr = exceptionToStatus()); } } |