Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -289,17 +289,30 @@ class DefaultEngineCreateService
s"Failed to update engineNode: ${t.getMessage}"
)
}
if (Configuration.METRICS_INCREMENTAL_UPDATE_ENABLE.getValue) {
val emInstance = engineNode.getServiceInstance.getInstance
val ecmInstance = engineNode.getEMNode.getServiceInstance.getInstance
// 8. Update job history metrics after successful engine creation - 异步执行
AMUtils.updateMetricsAsync(
taskId,
resourceTicketId,
emInstance,
ecmInstance,
null,
isReuse = false
Utils.tryCatch {
if (Configuration.METRICS_INCREMENTAL_UPDATE_ENABLE.getValue) {
val emInstance = engineNode.getServiceInstance.getInstance
val ecmInstance = engineNode.getEMNode.getServiceInstance.getInstance
if ((null != emInstance) && (null != ecmInstance)) {
// 8. Update job history metrics after successful engine creation - 异步执行
AMUtils.updateMetricsAsync(
taskId,
resourceTicketId,
emInstance,
ecmInstance,
null,
isReuse = false
)
} else {
logger.info(
s"CreateEngine:Failed to update metrics for emInstance: $emInstance, ecmInstance: $ecmInstance"
)
}
}
} { case e: Exception =>
logger.error(
s"Failed to update metrics for taskId: $taskId",
e
)
}
// 9. Add the Label of EngineConn, and add the Alias of engineConn
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -383,19 +383,31 @@ class DefaultEngineReuseService extends AbstractEngineService with EngineReuseSe
.toJson(engine) + " from engineLabelMap : " + AMUtils.GSON.toJson(instances)
)
}
if (Configuration.METRICS_INCREMENTAL_UPDATE_ENABLE.getValue) {
val engineNode =
ecResourceInfoService.getECResourceInfoRecordByInstance(
engine.getServiceInstance.getInstance
)
// 异步更新 metrics
AMUtils.updateMetricsAsync(
taskId,
engineNode.getTicketId,
engineNode.getServiceInstance,
engineNode.getEcmInstance,
engineNode.getLogDirSuffix,
isReuse = true
Utils.tryCatch {
if (Configuration.METRICS_INCREMENTAL_UPDATE_ENABLE.getValue) {
val engineNode =
ecResourceInfoService.getECResourceInfoRecordByInstance(
engine.getServiceInstance.getInstance
)
if (null != engineNode) {
// 异步更新 metrics
AMUtils.updateMetricsAsync(
taskId,
engineNode.getTicketId,
engineNode.getServiceInstance,
engineNode.getEcmInstance,
engineNode.getLogDirSuffix,
isReuse = true
)
} else {
logger.info(s"ReuseEngine:Failed to update metrics for engineNode: $engineNode")
}

}
} { case e: Exception =>
logger.error(
s"Failed to update metrics for taskId: $taskId",
e
)
}
engine
Expand Down