Skip to content

Commit

Permalink
add logging for remote monitor execution flows (#1663)
Browse files Browse the repository at this point in the history
Signed-off-by: Surya Sashank Nistala <snistala@amazon.com>
(cherry picked from commit ba3e715)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
github-actions[bot] committed Oct 2, 2024
1 parent 3b84cfa commit 861fba4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
} else {
if (monitorCtx.remoteMonitors.containsKey(monitor.monitorType)) {
if (monitor.monitorType.endsWith(Monitor.MonitorType.DOC_LEVEL_MONITOR.value)) {
logger.info("Executing remote document monitor of type ${monitor.monitorType} id ${monitor.id}")
return RemoteDocumentLevelMonitorRunner().runMonitor(
monitor,
monitorCtx,
Expand All @@ -490,6 +491,7 @@ object MonitorRunnerService : JobRunner, CoroutineScope, AbstractLifecycleCompon
transportService = transportService
)
} else {
logger.info("Executing remote monitor of type ${monitor.monitorType} id ${monitor.id}")
return monitorCtx.remoteMonitors[monitor.monitorType]!!.monitorRunner.runMonitor(
monitor,
periodStart,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,11 @@ class TransportDocLevelMonitorFanOutAction
)
)
} catch (e: Exception) {
log.error("${request.monitor.id} Failed to run fan_out on node ${clusterService.localNode().id} due to error $e")
log.error(
"${request.monitor.id} Failed to run fan_out on node ${clusterService.localNode().id}." +
" for Monitor Type ${request.monitor.monitorType} ExecutionId ${request.executionId}",
e
)
listener.onFailure(AlertingException.wrap(e))
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ open class RemoteMonitorRunner {
}

open fun getFanOutAction(): String {
return DocLevelMonitorFanOutAction.NAME
throw UnsupportedOperationException("Fan out action needs to be implemented by remote monitor.");
}

open suspend fun doFanOut(
Expand Down Expand Up @@ -185,4 +185,4 @@ open class RemoteMonitorRunner {
}
}
}
}
}

0 comments on commit 861fba4

Please sign in to comment.