Skip to content

Commit

Permalink
add logging for remote monitor execution flows (#1663) (#1689)
Browse files Browse the repository at this point in the history
(cherry picked from commit ba3e715)

Signed-off-by: Surya Sashank Nistala <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent bb01d27 commit a05e388
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 a05e388

Please sign in to comment.