From 703eb501e781a509ad5ec615eaa462598bbe82d1 Mon Sep 17 00:00:00 2001 From: peacewong Date: Mon, 11 Sep 2023 22:30:05 +0800 Subject: [PATCH] code optimize --- .../conf/linkis-et-monitor-ims.properties | 143 ++++++++++++++++++ .../package/conf/linkis-et-monitor.properties | 86 +++++++++++ .../LinksMonitorResourceApplication.java | 2 +- .../app => }/bml/cleaner/dao/VersionDao.java | 9 +- .../entity/CleanedResourceVersion.java | 2 +- .../bml/cleaner/entity/ResourceVersion.java | 2 +- .../bml/cleaner/service/CleanerService.java | 2 +- .../bml/cleaner/service/VersionService.java | 5 +- .../service/impl/CleanerServiceImpl.java | 18 +-- .../service/impl/VersionServiceImpl.java | 13 +- .../bml/cleaner/vo/CleanResourceVo.java | 2 +- .../monitor => }/config/ListenerConfig.java | 8 +- .../monitor => }/config/MonitorConfig.java | 12 +- .../monitor => }/config/ScheduledConfig.java | 2 +- .../app/monitor => }/entity/EngineEntity.java | 2 +- .../monitor => }/entity/EntranceEntity.java | 2 +- .../app/monitor => }/entity/IndexEntity.java | 4 +- .../instance/dao/InsLabelRelationDao.java | 5 +- .../instance/dao/InstanceInfoDao.java | 5 +- .../instance/dao/InstanceLabelDao.java | 5 +- .../instance/entity/InsPersistenceLabel.java | 2 +- .../entity/InsPersistenceLabelValue.java | 2 +- .../instance/entity/InstanceInfo.java | 2 +- .../{scan/app => }/jobhistory/QueryUtils.java | 2 +- .../jobhistory/dao/JobHistoryMapper.java | 5 +- .../jobhistory/entity/JobHistory.java | 5 +- .../exception/AnomalyScannerException.java | 2 +- .../exception/DirtyDataCleanException.java | 2 +- .../app/monitor/entity/ChatbotEntity.java | 97 ------------ .../app/monitor/scheduled/ValidatorClear.java | 51 ------- .../app/monitor => }/scheduled/BmlClear.java | 10 +- .../monitor => }/scheduled/EcRecordClear.java | 8 +- .../EntranceTaskMonitor.java} | 31 ++-- .../scheduled/JobHistoryClear.java | 10 +- .../scheduled/JobHistoryMonitor.java | 83 +++++----- .../scheduled/ResourceMonitor.java | 22 ++- .../monitor => }/scheduled/TaskLogClear.java | 8 +- .../scheduled/UserModeMonitor.java | 16 +- .../app/monitor => }/until/CacheUtils.java | 2 +- .../app/monitor => }/until/HttpsUntils.java | 33 ++-- .../app/monitor => }/until/ThreadUtils.java | 17 +-- .../mapper/common/InsLabelRelationMapper.xml | 10 +- .../mapper/common/InstanceInfoMapper.xml | 4 +- .../mapper/common/InstanceLabelMapper.xml | 4 +- .../mapper/common/JobHistoryMapper.xml | 6 +- ...kisJobHistoryScanSpringConfiguration.scala | 9 +- .../{scan => }/client/MonitorHTTPClient.scala | 6 +- .../client/MonitorHTTPClientClientImpl.scala | 4 +- .../client/MonitorResourceClient.scala | 4 +- .../client/MonitorResourceClientImpl.scala | 4 +- .../{scan => }/constants/Constants.scala | 39 +++-- .../constants/ScanOperatorEnum.scala | 2 +- .../monitor/{scan => }/core/ob/Event.scala | 2 +- .../monitor/{scan => }/core/ob/Observer.scala | 2 +- .../core/ob/SingleObserverEvent.java | 2 +- .../core/pac/AbstractDataFetcher.scala | 2 +- .../core/pac/AbstractScanRule.scala | 6 +- .../{scan => }/core/pac/BaseScannedData.scala | 2 +- .../{scan => }/core/pac/DataFetcher.scala | 2 +- .../{scan => }/core/pac/ScanBuffer.scala | 2 +- .../{scan => }/core/pac/ScanRule.scala | 6 +- .../{scan => }/core/pac/ScannedData.scala | 2 +- .../core/scanner/AbstractScanner.scala | 34 +++-- .../core/scanner/AnomalyScanner.scala | 8 +- .../core/scanner/DefaultScanner.scala | 4 +- .../app => }/factory/MapperFactory.scala | 11 +- .../jobhistory/JobHistoryDataFetcher.scala | 17 ++- .../errorcode/JobHistoryErrCodeHitEvent.scala | 4 +- .../errorcode/JobHistoryErrCodeRule.scala | 11 +- .../JobHistoryErrorCodeAlertSender.scala | 13 +- .../jobtime/JobTimeExceedAlertSender.scala | 15 +- .../jobtime/JobTimeExceedHitEvent.scala | 4 +- .../jobtime/JobTimeExceedRule.scala | 17 +-- .../labels/JobHistoryLabelsAlertSender.scala | 15 +- .../labels/JobHistoryLabelsHitEvent.scala | 4 +- .../labels/JobHistoryLabelsRule.scala | 15 +- .../runtime/CommonJobRunTimeRule.scala | 14 +- .../runtime/CommonRunTimeAlertSender.scala | 14 +- .../runtime/CommonRunTimeHitEvent.scala | 4 +- .../JobHistoryRunTimeAlertSender.scala | 13 +- .../runtime/JobHistoryRunTimeHitEvent.scala | 4 +- .../runtime/JobHistoryRunTimeRule.scala | 17 +-- .../{scan => }/request/EmsListAction.scala | 2 +- .../request/EntranceTaskAction.scala | 2 +- .../request/MonitorResourceAction.scala | 2 +- .../{scan => }/request/UserAction.scala | 2 +- .../response/EntranceTaskResult.scala | 2 +- .../response/MonitorResourceResult.scala | 2 +- .../monitor/{scan => }/utils/ScanUtils.java | 2 +- .../{scan => }/utils/alert/AlertDesc.scala | 2 +- .../{scan => }/utils/alert/AlertSender.scala | 2 +- .../utils/alert/PooledAlertSender.scala | 2 +- .../utils/alert/ims/ImsAlertDesc.scala | 11 +- .../utils/alert/ims/ImsAlertLevel.scala | 2 +- .../alert/ims/ImsAlertPropFileData.scala | 2 +- .../utils/alert/ims/ImsAlertWay.scala | 2 +- .../utils/alert/ims/ImsRequest.scala | 2 +- .../utils/alert/ims/MonitorAlertUtils.scala | 13 +- .../alert/ims/PooledImsAlertSender.scala | 8 +- .../utils/alert/ims/PooledImsAlertUtils.scala | 6 +- .../utils/alert/ims/UserLabelAlertUtils.scala | 11 +- .../{scan => }/utils/log/LogUtils.scala | 2 +- .../utils/alert/PooledImsAlertSenderTest.java | 10 +- .../utils/alert/PooledImsAlertUtilsTest.java | 8 +- 104 files changed, 620 insertions(+), 574 deletions(-) create mode 100644 linkis-dist/package/conf/linkis-et-monitor-ims.properties create mode 100644 linkis-dist/package/conf/linkis-et-monitor.properties rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/LinksMonitorResourceApplication.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/dao/VersionDao.java (89%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/entity/CleanedResourceVersion.java (98%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/entity/ResourceVersion.java (98%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/service/CleanerService.java (93%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/service/VersionService.java (85%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/service/impl/CleanerServiceImpl.java (91%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/service/impl/VersionServiceImpl.java (81%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/bml/cleaner/vo/CleanResourceVo.java (95%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/config/ListenerConfig.java (84%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/config/MonitorConfig.java (85%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/config/ScheduledConfig.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/entity/EngineEntity.java (95%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/entity/EntranceEntity.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/entity/IndexEntity.java (94%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/dao/InsLabelRelationDao.java (85%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/dao/InstanceInfoDao.java (88%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/dao/InstanceLabelDao.java (85%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/entity/InsPersistenceLabel.java (97%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/entity/InsPersistenceLabelValue.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/instance/entity/InstanceInfo.java (97%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/jobhistory/QueryUtils.java (95%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/jobhistory/dao/JobHistoryMapper.java (92%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/jobhistory/entity/JobHistory.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/jobhistory/exception/AnomalyScannerException.java (95%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app => }/jobhistory/exception/DirtyDataCleanException.java (95%) delete mode 100644 linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/ChatbotEntity.java delete mode 100644 linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ValidatorClear.java rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/BmlClear.java (83%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/EcRecordClear.java (87%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor/scheduled/TaskMonitor.java => scheduled/EntranceTaskMonitor.java} (89%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/JobHistoryClear.java (84%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/JobHistoryMonitor.java (77%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/ResourceMonitor.java (90%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/TaskLogClear.java (87%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/scheduled/UserModeMonitor.java (94%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/until/CacheUtils.java (95%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/until/HttpsUntils.java (82%) rename linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/{scan/app/monitor => }/until/ThreadUtils.java (80%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/LinkisJobHistoryScanSpringConfiguration.scala (85%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/client/MonitorHTTPClient.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/client/MonitorHTTPClientClientImpl.scala (92%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/client/MonitorResourceClient.scala (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/client/MonitorResourceClientImpl.scala (92%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/constants/Constants.scala (70%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/constants/ScanOperatorEnum.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/ob/Event.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/ob/Observer.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/ob/SingleObserverEvent.java (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/AbstractDataFetcher.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/AbstractScanRule.scala (89%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/BaseScannedData.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/DataFetcher.scala (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/ScanBuffer.scala (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/ScanRule.scala (88%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/pac/ScannedData.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/scanner/AbstractScanner.scala (83%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/scanner/AnomalyScanner.scala (90%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/core/scanner/DefaultScanner.scala (88%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/factory/MapperFactory.scala (85%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/JobHistoryDataFetcher.scala (86%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/errorcode/JobHistoryErrCodeHitEvent.scala (86%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/errorcode/JobHistoryErrCodeRule.scala (89%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/errorcode/JobHistoryErrorCodeAlertSender.scala (89%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/jobtime/JobTimeExceedAlertSender.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/jobtime/JobTimeExceedHitEvent.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/jobtime/JobTimeExceedRule.scala (85%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/labels/JobHistoryLabelsAlertSender.scala (83%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/labels/JobHistoryLabelsHitEvent.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/labels/JobHistoryLabelsRule.scala (91%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/CommonJobRunTimeRule.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/CommonRunTimeAlertSender.scala (89%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/CommonRunTimeHitEvent.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/JobHistoryRunTimeAlertSender.scala (86%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/JobHistoryRunTimeHitEvent.scala (87%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan/app => }/jobhistory/runtime/JobHistoryRunTimeRule.scala (85%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/request/EmsListAction.scala (97%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/request/EntranceTaskAction.scala (98%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/request/MonitorResourceAction.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/request/UserAction.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/response/EntranceTaskResult.scala (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/response/MonitorResourceResult.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/ScanUtils.java (97%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/AlertDesc.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/AlertSender.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/PooledAlertSender.scala (98%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/ImsAlertDesc.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/ImsAlertLevel.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/ImsAlertPropFileData.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/ImsAlertWay.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/ImsRequest.scala (96%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/MonitorAlertUtils.scala (94%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/PooledImsAlertSender.scala (93%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/PooledImsAlertUtils.scala (95%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/alert/ims/UserLabelAlertUtils.scala (86%) rename linkis-extensions/linkis-et-monitor/src/main/scala/org/apache/linkis/monitor/{scan => }/utils/log/LogUtils.scala (94%) rename linkis-extensions/linkis-et-monitor/src/test/java/org/apache/linkis/monitor/{scan => }/utils/alert/PooledImsAlertSenderTest.java (86%) rename linkis-extensions/linkis-et-monitor/src/test/java/org/apache/linkis/monitor/{scan => }/utils/alert/PooledImsAlertUtilsTest.java (87%) diff --git a/linkis-dist/package/conf/linkis-et-monitor-ims.properties b/linkis-dist/package/conf/linkis-et-monitor-ims.properties new file mode 100644 index 0000000000..22a45841d8 --- /dev/null +++ b/linkis-dist/package/conf/linkis-et-monitor-ims.properties @@ -0,0 +1,143 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +jobhistory.errorcode.01002={"alert_title":"Linkis Service load is too high, please contact Linkis owner","alert_info":"Linkis Linkis Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01003={"alert_title":"Linkis Service load is too high, please contact Linkis owner","alert_info":"Linkis Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01101={"alert_title":"Linkis Service load is too high, please contact Linkis owner","alert_info":" Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01102={"alert_title":"Linkis ECM memory Service load is too high, please contact Linkis owner","alert_info":" Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01103={"alert_title":"Linkis ECM CPU Service load is too high, please contact Linkis owner","alert_info":" Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01104={"alert_title":"Linkis ECM instances Service load is too high, please contact Linkis owner","alert_info":" Service load is too high, please contact Linkis owner","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.errorcode.01105={"alert_title":"Linkis Memory Service load is too high, please contact Linkis owner","alert_info":"The machine has insufficient memory. Please contact the administrator to expand the memory.","alert_way":"1,2,3","alert_reciver":"hadoop","alert_level":"2","alert_obj":"linkis-alert-obj","can_recover":"0"} +jobhistory.unfinished.time.exceed.sec.43200={"alert_title":"Linkis task execute timeout","alert_info":"Linkis task execute timeout 12h","alert_way":"1,2,3","alert_reciver":"","alert_level":"4","alert_obj":"Linkis","can_recover":"0"} + +ecm.resource.monitor.im.12003=\ + {"alert_title":"Linkis Monitor Resource Alert",\ + "alert_info":" $instance ECM Memory/cpu insufficient resource < 0.2 please contact Linkis owner: $name",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12004=\ + {"alert_title":"Linkis Monitor Resource Alert",\ + "alert_info":" $instance ECM Memory/cpu insufficient resource < 0.2 please contact Linkis owner: $name",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"2",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12005=\ + {"alert_title":"Linkis entrance user running task monitor",\ + "alert_info":"User $username runninng task at linkis ( $url ) > $runningtask ,please attention",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12006=\ + {"alert_title":"Linkis entrance user queued task monitor",\ + "alert_info":"User $username queued task at linkis ( $url ) > $queuedtask ,please attention",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12007=\ + {"alert_title":"Linkis entrance user total task monitor",\ + "alert_info":"User $username queued task at linkis ( $url ) > $tasktotal ,please attention",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12008=\ + {"alert_title":"Linkis entrance all running task monitor",\ + "alert_info":"linkis ( $url ) running task > $taskminor,please attention",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +ecm.resource.monitor.im.12009=\ + {"alert_title":"Linkis entrance all running task monitor",\ + "alert_info":"linkis ( $url ) all task > $taskmajor,please attention",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"2",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} + + + +user.mode.monitor.im.12011=\ + {"alert_title":"User mode execution timeout alarm",\ + "alert_info":"User mode execution timeout alarm Linkis url: $url engineType:$engineType Task ID: $jobId please attention $name",\ + "alert_way":"1,2,3",\ + "alert_reciver":"alexyang,hadoop",\ + "alert_level":"2",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +user.mode.monitor.im.12012=\ + {"alert_title":"User mode execution failure alarm",\ + "alert_info":"User mode execution failure alarm Linkis url: $url Engine: $engineType TaskID: $jobId ER=rrorCode?$errorCode errorMsg: $errorMsg please attention $name",\ + "alert_way":"1,2,3",\ + "alert_reciver":"alexyang,hadoop",\ + "alert_level":"2",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} + +user.mode.monitor.im.12017=\ + {"alert_title":"@alert_title",\ + "alert_info":"task execute failed, reason $msg",\ + "alert_way":"1,2,3",\ + "alert_reciver":"@alert_reciver",\ + "alert_level":"@alert_level",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +user.mode.monitor.im.12018=\ + {"alert_title":"@alert_title",\ + "alert_info":"task execute time out $timeout",\ + "alert_way":"1,2,3",\ + "alert_reciver":"@alert_reciver",\ + "alert_level":"@alert_level",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} + +thread.monitor.timeout.im.12014=\ + {"alert_title":" Linkis Shell Timeout Alert ",\ + "alert_info":"Monitor Shell execute time out $shellName",\ + "alert_way":"1,2,3",\ + "alert_reciver":"hadoop",\ + "alert_level":"3",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +jobhistory.result.monitor.im.12015=\ + {"alert_title":"Linkis \u4EFB\u52A1\u72B6\u6001\u901A\u77E5",\ + "alert_info":"Task ID:$id final status: $status",\ + "alert_way":"1,2,3",\ + "alert_reciver":"",\ + "alert_level":"4",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} +jobhistory.result.monitor.im.12016=\ + {"alert_title":"@alert_title",\ + "alert_info":"[Alarm time]$date\n[Subsystem]$sysid\n[Alarm IP]$ip\n[Alarm object]$object\n[Alarm information]$detail",\ + "alert_way":"1,2,3",\ + "alert_reciver":"@alert_reciver",\ + "alert_level":"@alert_level",\ + "alert_obj":"linkis_alert",\ + "can_recover":"0"} + + diff --git a/linkis-dist/package/conf/linkis-et-monitor.properties b/linkis-dist/package/conf/linkis-et-monitor.properties new file mode 100644 index 0000000000..92fcc188af --- /dev/null +++ b/linkis-dist/package/conf/linkis-et-monitor.properties @@ -0,0 +1,86 @@ +# +# Licensed to the Apache Software Foundation (ASF) under one or more +# contributor license agreements. See the NOTICE file distributed with +# this work for additional information regarding copyright ownership. +# The ASF licenses this file to You under the Apache License, Version 2.0 +# (the "License"); you may not use this file except in compliance with +# the License. You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +wds.linkis.server.mybatis.typeAliasesPackage=org.apache.linkis.monitor.scan.app.instance.entity,org.apache.linkis.monitor.scan.app.jobhistory.entity,org.apache.linkis.bml.cleaner.dao +wds.linkis.server.mybatis.BasePackage=org.apache.linkis.monitor.scan.app.instance.dao,org.apache.linkis.monitor.scan.app.jobhistory.dao,org.apache.linkis.bml.cleaner.dao + + +# alert server url +linkis.alert.url=http://127.0.0.1/ + +# alert receiver +linkis.alert.receiver.default=hadoop + +# monitor ecm resource +linkis.monitor.ecm.resource.cron=0 0/10 * * * ? + +# Resource remaining ratio +linkis.monitor.ecmResourceTask.major=0.005 +linkis.monitor.ecmResourceTask.minor=0.01 + +# entrance task metrics cron +linkis.monitor.entrance.task.cron=0 0/10 * * * ? + +# Timeout task cron +linkis.monitor.jobHistory.timeout.cron=0 0/20 * * * ? + +# time out interval 24h +linkis.monitor.scanner.timeout.interval.seconds=86400 + + +# Finished task cron +linkis.monitor.jobHistory.finished.cron=0 0/20 * * * ? + +# linkis user mode cron +linkis.monitor.user.mode.cron=0 0/20 * * * ? + +# user mode for engine +linkis.monitor.user.enginelist=[{"engineType":"hive-2.3.3","code":"show tables","runType":"hql","executeUser":"hadoop"},\ + {"engineType":"spark-2.4.3","code":"show tables","runType":"sql","executeUser":"hadoop"},\ + {"engineType":"shell-1","code":"pwd","runType":"sh","executeUser":"hadoop"}] + +linkis.monitor.user.authToken=BML-AUTH + +linkis.monitor.user.mode.timeOut=300 + + +# bml clear cron +linkis.monitor.bml.clear.history.version.cron=0 0 12 * * ? +# bml max version +linkis.bml.cleaner.version.max.num=50 +# keep verssion +linkis.bml.cleaner.version.keep.num=20 +# clear max interval +linkis.bml.cleaner.previous.interval.days=30 +# once scan limit +linkis.bml.cleaner.once.limit.num=100 + +# clear db ec record cron +linkis.monitor.clear.ecRecord.cron=0 10 12 * * ? + +# clear task log cron +linkis.monitor.clear.taskLog.cron=0 10 12 * * ? + +# clear db task history cron +linkis.monitor.clear.history.task.cron=0 0 13 * * ? + +# poll size +linkis.monitor.scheduled.pool.cores.num=20 + +# shell time out conf minute +linkis.monitor.shell.time.out.minute=60 + +##Spring +spring.server.port=9119 diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/LinksMonitorResourceApplication.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/LinksMonitorResourceApplication.java similarity index 96% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/LinksMonitorResourceApplication.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/LinksMonitorResourceApplication.java index 405d94037b..941c722f77 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/LinksMonitorResourceApplication.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/LinksMonitorResourceApplication.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app; +package org.apache.linkis.monitor; import org.apache.linkis.LinkisBaseServerApp; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/dao/VersionDao.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/dao/VersionDao.java similarity index 89% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/dao/VersionDao.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/dao/VersionDao.java index 6b6a101b45..5f498500eb 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/dao/VersionDao.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/dao/VersionDao.java @@ -15,11 +15,12 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.dao; +package org.apache.linkis.monitor.bml.cleaner.dao; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.CleanedResourceVersion; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.ResourceVersion; -import org.apache.linkis.monitor.scan.app.bml.cleaner.vo.CleanResourceVo; +import org.apache.linkis.monitor.bml.cleaner.vo.CleanResourceVo; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.entity.ResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.vo.CleanResourceVo; import org.apache.ibatis.annotations.*; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/CleanedResourceVersion.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/CleanedResourceVersion.java similarity index 98% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/CleanedResourceVersion.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/CleanedResourceVersion.java index 3c6f103183..5a0bfcc487 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/CleanedResourceVersion.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/CleanedResourceVersion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.entity; +package org.apache.linkis.monitor.bml.cleaner.entity; import java.util.Date; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/ResourceVersion.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/ResourceVersion.java similarity index 98% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/ResourceVersion.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/ResourceVersion.java index 604ab3662a..5d297cf180 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/entity/ResourceVersion.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/entity/ResourceVersion.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.entity; +package org.apache.linkis.monitor.bml.cleaner.entity; import java.util.Date; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/CleanerService.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/CleanerService.java similarity index 93% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/CleanerService.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/CleanerService.java index ccbea7d8c7..0dfa15f396 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/CleanerService.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/CleanerService.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.service; +package org.apache.linkis.monitor.bml.cleaner.service; public interface CleanerService { diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/VersionService.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/VersionService.java similarity index 85% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/VersionService.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/VersionService.java index 3162c096e9..5cc2ee217e 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/VersionService.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/VersionService.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.service; +package org.apache.linkis.monitor.bml.cleaner.service; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; import org.apache.linkis.common.io.FsPath; import org.apache.linkis.storage.fs.FileSystem; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/CleanerServiceImpl.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/CleanerServiceImpl.java similarity index 91% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/CleanerServiceImpl.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/CleanerServiceImpl.java index e17d55b7dd..0005cc08fe 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/CleanerServiceImpl.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/CleanerServiceImpl.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.service.impl; - -import org.apache.linkis.monitor.scan.app.bml.cleaner.dao.VersionDao; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.CleanedResourceVersion; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.ResourceVersion; -import org.apache.linkis.monitor.scan.app.bml.cleaner.service.CleanerService; -import org.apache.linkis.monitor.scan.app.bml.cleaner.service.VersionService; -import org.apache.linkis.monitor.scan.app.bml.cleaner.vo.CleanResourceVo; +package org.apache.linkis.monitor.bml.cleaner.service.impl; + +import org.apache.linkis.monitor.bml.cleaner.dao.VersionDao; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.entity.ResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.service.CleanerService; +import org.apache.linkis.monitor.bml.cleaner.vo.CleanResourceVo; +import org.apache.linkis.monitor.bml.cleaner.service.VersionService; import org.apache.linkis.common.io.FsPath; -import org.apache.linkis.monitor.scan.constants.Constants; +import org.apache.linkis.monitor.constants.Constants; import org.apache.linkis.storage.FSFactory; import org.apache.linkis.storage.fs.FileSystem; import org.apache.linkis.storage.utils.StorageConfiguration; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/VersionServiceImpl.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/VersionServiceImpl.java similarity index 81% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/VersionServiceImpl.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/VersionServiceImpl.java index 8234d524af..8e78baa31b 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/service/impl/VersionServiceImpl.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/service/impl/VersionServiceImpl.java @@ -15,11 +15,13 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.service.impl; +package org.apache.linkis.monitor.bml.cleaner.service.impl; -import org.apache.linkis.monitor.scan.app.bml.cleaner.dao.VersionDao; -import org.apache.linkis.monitor.scan.app.bml.cleaner.entity.CleanedResourceVersion; -import org.apache.linkis.monitor.scan.app.bml.cleaner.service.VersionService; +import org.apache.linkis.monitor.bml.cleaner.dao.VersionDao; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.dao.VersionDao; +import org.apache.linkis.monitor.bml.cleaner.entity.CleanedResourceVersion; +import org.apache.linkis.monitor.bml.cleaner.service.VersionService; import org.apache.linkis.common.io.FsPath; import org.apache.linkis.storage.fs.FileSystem; @@ -32,7 +34,8 @@ @Service public class VersionServiceImpl implements VersionService { - @Autowired VersionDao versionDao; + @Autowired + VersionDao versionDao; public void setVersionDao(VersionDao versionDao) { this.versionDao = versionDao; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/vo/CleanResourceVo.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/vo/CleanResourceVo.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/vo/CleanResourceVo.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/vo/CleanResourceVo.java index cfcf6e5ea6..4ef205effd 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/bml/cleaner/vo/CleanResourceVo.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/bml/cleaner/vo/CleanResourceVo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.bml.cleaner.vo; +package org.apache.linkis.monitor.bml.cleaner.vo; public class CleanResourceVo { private String resourceId; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ListenerConfig.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ListenerConfig.java similarity index 84% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ListenerConfig.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ListenerConfig.java index fae16b63a3..eb5c11af87 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ListenerConfig.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ListenerConfig.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.config; +package org.apache.linkis.monitor.config; -import org.apache.linkis.monitor.scan.app.monitor.until.HttpsUntils; -import org.apache.linkis.monitor.scan.app.monitor.until.ThreadUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.until.HttpsUntils; +import org.apache.linkis.monitor.until.ThreadUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.annotation.Configuration; import org.springframework.context.event.ContextClosedEvent; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/MonitorConfig.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/MonitorConfig.java similarity index 85% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/MonitorConfig.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/MonitorConfig.java index 32b47c289c..50516e140c 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/MonitorConfig.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/MonitorConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.config; +package org.apache.linkis.monitor.config; import org.apache.linkis.common.conf.CommonVars; import org.apache.linkis.common.conf.Configuration; @@ -29,7 +29,7 @@ public class MonitorConfig { public static final CommonVars USER_MODE_TIMEOUT = CommonVars.apply("linkis.monitor.user.timeOut", 300); public static final CommonVars USER_MODE_AUTHTOKEN = - CommonVars.apply("linkis.monitor.user.authToken", "VALIDATOR-AUTH"); + CommonVars.apply("linkis.monitor.user.authToken", "BML-AUTH"); public static final CommonVars USER_MODE_ENGINE = CommonVars.apply("linkis.monitor.user.enginelist", "[]"); @@ -63,14 +63,6 @@ public class MonitorConfig { public static final CommonVars USER_MODE_INTERFACE_TIMEOUT = CommonVars.apply("linkis.monitor.user.mode.time.out", 30 * 1000); - public static final CommonVars CHATBOT_KEY_ID = - CommonVars.apply("linkis.monitor.chatbot.key.id", "23e6afad1b78a0c5eed67e4d24de7063"); - public static final CommonVars CHATBOT_TYPE = - CommonVars.apply("linkis.monitor.chatbot.type", "text"); - public static final CommonVars CHATBOT_SERVICE_NAME = - CommonVars.apply("linkis.monitor.chatbot.serviceName", ""); - public static final CommonVars CHATBOT_URL = - CommonVars.apply("linkis.monitor.chatbot.url", ""); public static final CommonVars SOLUTION_URL = CommonVars.apply( "linkis.monitor.jobhistory.solution.url", diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ScheduledConfig.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ScheduledConfig.java similarity index 96% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ScheduledConfig.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ScheduledConfig.java index 30495a87e1..e954122671 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/config/ScheduledConfig.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/config/ScheduledConfig.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.config; +package org.apache.linkis.monitor.config; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EngineEntity.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EngineEntity.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EngineEntity.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EngineEntity.java index 650fa081cc..760c06ba1b 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EngineEntity.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EngineEntity.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.entity; +package org.apache.linkis.monitor.entity; import java.io.Serializable; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EntranceEntity.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EntranceEntity.java similarity index 96% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EntranceEntity.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EntranceEntity.java index 6fa9441474..241439b499 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/EntranceEntity.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/EntranceEntity.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.entity; +package org.apache.linkis.monitor.entity; import java.io.Serializable; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/IndexEntity.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/IndexEntity.java similarity index 94% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/IndexEntity.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/IndexEntity.java index fbea8886e8..2905f8aced 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/IndexEntity.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/entity/IndexEntity.java @@ -15,9 +15,9 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.entity; +package org.apache.linkis.monitor.entity; -import org.apache.linkis.monitor.scan.constants.Constants; +import org.apache.linkis.monitor.constants.Constants; public class IndexEntity { diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InsLabelRelationDao.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InsLabelRelationDao.java similarity index 85% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InsLabelRelationDao.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InsLabelRelationDao.java index 3705288e66..9e573f42d4 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InsLabelRelationDao.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InsLabelRelationDao.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.dao; +package org.apache.linkis.monitor.instance.dao; -import org.apache.linkis.monitor.scan.app.instance.entity.InsPersistenceLabel; +import org.apache.linkis.monitor.instance.entity.InsPersistenceLabel; +import org.apache.linkis.monitor.instance.entity.InsPersistenceLabel; import java.util.List; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceInfoDao.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceInfoDao.java similarity index 88% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceInfoDao.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceInfoDao.java index 73a7166a5f..136df3a252 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceInfoDao.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceInfoDao.java @@ -15,10 +15,11 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.dao; +package org.apache.linkis.monitor.instance.dao; import org.apache.linkis.common.ServiceInstance; -import org.apache.linkis.monitor.scan.app.instance.entity.InstanceInfo; +import org.apache.linkis.monitor.instance.entity.InstanceInfo; +import org.apache.linkis.monitor.instance.entity.InstanceInfo; import org.apache.ibatis.annotations.Param; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceLabelDao.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceLabelDao.java similarity index 85% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceLabelDao.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceLabelDao.java index 5fa3b7a5c0..4476444460 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/dao/InstanceLabelDao.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/dao/InstanceLabelDao.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.dao; +package org.apache.linkis.monitor.instance.dao; -import org.apache.linkis.monitor.scan.app.instance.entity.InsPersistenceLabel; +import org.apache.linkis.monitor.instance.entity.InsPersistenceLabel; +import org.apache.linkis.monitor.instance.entity.InsPersistenceLabel; import java.util.List; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabel.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabel.java similarity index 97% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabel.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabel.java index 36fb21c13b..0959c27988 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabel.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabel.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.entity; +package org.apache.linkis.monitor.instance.entity; import java.util.Date; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabelValue.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabelValue.java similarity index 96% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabelValue.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabelValue.java index 53ab4bd806..029f552608 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InsPersistenceLabelValue.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InsPersistenceLabelValue.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.entity; +package org.apache.linkis.monitor.instance.entity; public class InsPersistenceLabelValue { diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InstanceInfo.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InstanceInfo.java similarity index 97% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InstanceInfo.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InstanceInfo.java index a74cfaabb0..5360ffd323 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/instance/entity/InstanceInfo.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/instance/entity/InstanceInfo.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.instance.entity; +package org.apache.linkis.monitor.instance.entity; import java.util.ArrayList; import java.util.Date; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/QueryUtils.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/QueryUtils.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/QueryUtils.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/QueryUtils.java index 799eae89a6..aa73471c49 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/QueryUtils.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/QueryUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.jobhistory; +package org.apache.linkis.monitor.jobhistory; import java.text.DateFormat; import java.text.SimpleDateFormat; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/dao/JobHistoryMapper.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/dao/JobHistoryMapper.java similarity index 92% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/dao/JobHistoryMapper.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/dao/JobHistoryMapper.java index bfdc640652..a3cf6fa823 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/dao/JobHistoryMapper.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/dao/JobHistoryMapper.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.jobhistory.dao; +package org.apache.linkis.monitor.jobhistory.dao; -import org.apache.linkis.monitor.scan.app.jobhistory.entity.JobHistory; +import org.apache.linkis.monitor.jobhistory.entity.JobHistory; +import org.apache.linkis.monitor.jobhistory.entity.JobHistory; import org.apache.ibatis.annotations.Param; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/entity/JobHistory.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/entity/JobHistory.java similarity index 96% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/entity/JobHistory.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/entity/JobHistory.java index 937eff410b..ae378ec202 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/entity/JobHistory.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/entity/JobHistory.java @@ -15,9 +15,10 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.jobhistory.entity; +package org.apache.linkis.monitor.jobhistory.entity; -import org.apache.linkis.monitor.scan.app.jobhistory.QueryUtils; +import org.apache.linkis.monitor.jobhistory.QueryUtils; +import org.apache.linkis.monitor.jobhistory.QueryUtils; import java.util.Date; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/AnomalyScannerException.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/AnomalyScannerException.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/AnomalyScannerException.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/AnomalyScannerException.java index 0e3dd10d6b..b2c83be013 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/AnomalyScannerException.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/AnomalyScannerException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.jobhistory.exception; +package org.apache.linkis.monitor.jobhistory.exception; import org.apache.linkis.common.exception.ErrorException; import org.apache.linkis.common.exception.ExceptionLevel; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/DirtyDataCleanException.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/DirtyDataCleanException.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/DirtyDataCleanException.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/DirtyDataCleanException.java index 93b6065f75..b1c5e64743 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/jobhistory/exception/DirtyDataCleanException.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/jobhistory/exception/DirtyDataCleanException.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.jobhistory.exception; +package org.apache.linkis.monitor.jobhistory.exception; import org.apache.linkis.common.exception.ErrorException; import org.apache.linkis.common.exception.ExceptionLevel; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/ChatbotEntity.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/ChatbotEntity.java deleted file mode 100644 index 4f912b9e82..0000000000 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/entity/ChatbotEntity.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.linkis.monitor.scan.app.monitor.entity; - -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; - -public class ChatbotEntity { - private String keyid; - private String content; - private String type; - private String userName; - private String serviceName; - - public ChatbotEntity(String content, String userName) { - this.keyid = MonitorConfig.CHATBOT_KEY_ID.getValue(); - this.content = content; - this.type = MonitorConfig.CHATBOT_TYPE.getValue(); - this.userName = userName; - this.serviceName = MonitorConfig.CHATBOT_SERVICE_NAME.getValue(); - } - - public String getKeyid() { - return keyid; - } - - public void setKeyid(String keyid) { - this.keyid = keyid; - } - - public String getContent() { - return content; - } - - public void setContent(String content) { - this.content = content; - } - - public String getType() { - return type; - } - - public void setType(String type) { - this.type = type; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getServiceName() { - return serviceName; - } - - public void setServiceName(String serviceNameuserName) { - this.serviceName = serviceNameuserName; - } - - @Override - public String toString() { - return "ChatbotEntity{" - + "keyid='" - + keyid - + '\'' - + ", content='" - + content - + '\'' - + ", type='" - + type - + '\'' - + ", userName='" - + userName - + '\'' - + ", serviceName='" - + serviceName - + '\'' - + '}'; - } -} diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ValidatorClear.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ValidatorClear.java deleted file mode 100644 index 4df828e36c..0000000000 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ValidatorClear.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package org.apache.linkis.monitor.scan.app.monitor.scheduled; - -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.ThreadUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; - -import org.springframework.context.annotation.PropertySource; -import org.springframework.scheduling.annotation.Scheduled; -import org.springframework.stereotype.Component; - -import java.util.ArrayList; -import java.util.List; - -import org.slf4j.Logger; - -/** * Task: clean up linkis_et_validator_checkinfo data */ -@Component -@PropertySource(value = "classpath:linkis-et-monitor.properties", encoding = "UTF-8") -public class ValidatorClear { - - private static final Logger logger = LogUtils.stdOutLogger(); - - @Scheduled(cron = "${linkis.monitor.clear.validator.cron}") - public void ValidatorClear() { - logger.info("Start to clear_validator_record shell"); - List cmdlist = new ArrayList<>(); - cmdlist.add("sh"); - cmdlist.add(MonitorConfig.shellPath + "clear_validator_record.sh"); - logger.info("clear_validator_record shell command {}", cmdlist); - String exec = ThreadUtils.run(cmdlist, "clear_validator_record.sh"); - logger.info("shell log {}", exec); - logger.info("End to clear_validator_record shell "); - } -} diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/BmlClear.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/BmlClear.java similarity index 83% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/BmlClear.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/BmlClear.java index 362af45abe..cb7d37197f 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/BmlClear.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/BmlClear.java @@ -15,18 +15,16 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; -import org.apache.linkis.monitor.scan.app.bml.cleaner.service.CleanerService; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.bml.cleaner.service.CleanerService; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; -import java.util.*; - import org.slf4j.Logger; @Component @@ -37,7 +35,7 @@ public class BmlClear { @Autowired private CleanerService cleanerServices; - @Scheduled(cron = "${linkis.monitor.bml.clear.historyVersion.cron}") + @Scheduled(cron = "${linkis.monitor.bml.clear.history.version.cron}") public void jobHistoryScanTask() { logger.info("start to clear bml history version"); cleanerServices.run(); diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/EcRecordClear.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EcRecordClear.java similarity index 87% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/EcRecordClear.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EcRecordClear.java index ac9cb4ea61..ddb3d3e8c8 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/EcRecordClear.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EcRecordClear.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.ThreadUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.until.ThreadUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.Scheduled; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskMonitor.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EntranceTaskMonitor.java similarity index 89% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskMonitor.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EntranceTaskMonitor.java index 5f6728ef62..d28f6a73f8 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskMonitor.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/EntranceTaskMonitor.java @@ -15,16 +15,17 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; import org.apache.linkis.common.ServiceInstance; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.entity.IndexEntity; -import org.apache.linkis.monitor.scan.app.monitor.until.HttpsUntils; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.utils.alert.AlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.MonitorAlertUtils; -import org.apache.linkis.monitor.scan.utils.alert.ims.PooledImsAlertUtils; +import org.apache.linkis.governance.common.conf.GovernanceCommonConf; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.entity.IndexEntity; +import org.apache.linkis.monitor.until.HttpsUntils; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.utils.alert.AlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.MonitorAlertUtils; +import org.apache.linkis.monitor.utils.alert.ims.PooledImsAlertUtils; import org.apache.linkis.rpc.Sender; import org.apache.linkis.server.BDPJettyServerHelper; @@ -49,21 +50,21 @@ */ @Component @PropertySource(value = "classpath:linkis-et-monitor.properties", encoding = "UTF-8") -public class TaskMonitor { +public class EntranceTaskMonitor { - private static final Logger logger = LoggerFactory.getLogger(TaskMonitor.class); + private static final Logger logger = LoggerFactory.getLogger(EntranceTaskMonitor.class); private static final String ENTRANCE_RUNNING_TASK = "entrance_running_task"; private static final String ENTRANCE_QUEUED_TASK = "entrance_queued_task"; - @Scheduled(cron = "${linkis.monitor.entranceTask.cron}") + @Scheduled(cron = "${linkis.monitor.entrance.task.cron}") public void entranceTask() throws IOException { List> userlist = new ArrayList<>(); String value = MonitorConfig.ENTRANCE_TASK_USERLIST.getValue(); if (StringUtils.isNotBlank(value)) { userlist = BDPJettyServerHelper.gson().fromJson(value, ArrayList.class); } - // 用户监控 + userlist.forEach( entranceEntity -> { Map data = new HashMap<>(); @@ -110,7 +111,6 @@ public void entranceTask() throws IOException { } int usertotalTask = MonitorConfig.ENTRANCE_TASK_USERTOTAL.getValue(); if (total.intValue() > usertotalTask) { - // 触发告警 用户任务总数满 parms.put("$tasktotal", String.valueOf(usertotalTask)); Map ecmResourceAlerts = MonitorAlertUtils.getAlerts(Constants.ALERT_RESOURCE_MONITOR(), parms); @@ -142,21 +142,18 @@ public void entranceTask() throws IOException { PooledImsAlertUtils.addAlert(ecmResourceAlerts.get("12009")); } else if (total.intValue() >= linkisTotalMinor) { - // 触发告警Minor parms.put("$taskminor", String.valueOf(linkisTotalMinor)); logger.info("TaskMonitor parms {}:", parms); Map ecmResourceAlerts = MonitorAlertUtils.getAlerts(Constants.ALERT_RESOURCE_MONITOR(), parms); PooledImsAlertUtils.addAlert(ecmResourceAlerts.get("12008")); } - // 指标上报 resourceSendToIms(); } public static void resourceSendToIms() { - // 获取所有的entrance实例,逐个上送IMS ServiceInstance[] instances = - Sender.getInstances(Constants.DIRTY_DATA_ENTRANCE_APPLICATIONNAME()); + Sender.getInstances(GovernanceCommonConf.ENTRANCE_SERVICE_NAME().getValue()); if (null != instances) { for (ServiceInstance instance : instances) { String serviceInstance = instance.getInstance(); diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryClear.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryClear.java similarity index 84% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryClear.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryClear.java index ae14770420..346ca9cb06 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryClear.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryClear.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.ThreadUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.until.ThreadUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.Scheduled; @@ -37,7 +37,7 @@ public class JobHistoryClear { private static final Logger logger = LogUtils.stdOutLogger(); - @Scheduled(cron = "${linkis.monitor.clear.historyTask.cron}") + @Scheduled(cron = "${linkis.monitor.clear.history.task.cron}") public void historyTaskClear() { logger.info("Start to clear_history_task shell"); List cmdlist = new ArrayList<>(); diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryMonitor.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryMonitor.java similarity index 77% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryMonitor.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryMonitor.java index fbca945a8d..93dd028c3c 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/JobHistoryMonitor.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/JobHistoryMonitor.java @@ -15,31 +15,31 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; +import org.apache.linkis.monitor.jobhistory.JobHistoryDataFetcher; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.until.CacheUtils; import org.apache.linkis.monitor.scan.app.factory.MapperFactory; -import org.apache.linkis.monitor.scan.app.jobhistory.JobHistoryDataFetcher; -import org.apache.linkis.monitor.scan.app.jobhistory.errorcode.JobHistoryErrCodeRule; -import org.apache.linkis.monitor.scan.app.jobhistory.errorcode.JobHistoryErrorCodeAlertSender; -import org.apache.linkis.monitor.scan.app.jobhistory.jobtime.JobTimeExceedAlertSender; -import org.apache.linkis.monitor.scan.app.jobhistory.jobtime.JobTimeExceedRule; -import org.apache.linkis.monitor.scan.app.jobhistory.labels.JobHistoryLabelsAlertSender; -import org.apache.linkis.monitor.scan.app.jobhistory.labels.JobHistoryLabelsRule; -import org.apache.linkis.monitor.scan.app.jobhistory.runtime.CommonJobRunTimeRule; -import org.apache.linkis.monitor.scan.app.jobhistory.runtime.CommonRunTimeAlertSender; -import org.apache.linkis.monitor.scan.app.jobhistory.runtime.JobHistoryRunTimeAlertSender; -import org.apache.linkis.monitor.scan.app.jobhistory.runtime.JobHistoryRunTimeRule; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.CacheUtils; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.core.pac.DataFetcher; -import org.apache.linkis.monitor.scan.core.scanner.AnomalyScanner; -import org.apache.linkis.monitor.scan.core.scanner.DefaultScanner; -import org.apache.linkis.monitor.scan.utils.alert.AlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.ImsAlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.MonitorAlertUtils; -import org.apache.linkis.monitor.scan.utils.alert.ims.UserLabelAlertUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.jobhistory.errorcode.JobHistoryErrCodeRule; +import org.apache.linkis.monitor.jobhistory.errorcode.JobHistoryErrorCodeAlertSender; +import org.apache.linkis.monitor.jobhistory.jobtime.JobTimeExceedAlertSender; +import org.apache.linkis.monitor.jobhistory.jobtime.JobTimeExceedRule; +import org.apache.linkis.monitor.jobhistory.labels.JobHistoryLabelsAlertSender; +import org.apache.linkis.monitor.jobhistory.labels.JobHistoryLabelsRule; +import org.apache.linkis.monitor.jobhistory.runtime.CommonJobRunTimeRule; +import org.apache.linkis.monitor.jobhistory.runtime.CommonRunTimeAlertSender; +import org.apache.linkis.monitor.jobhistory.runtime.JobHistoryRunTimeAlertSender; +import org.apache.linkis.monitor.jobhistory.runtime.JobHistoryRunTimeRule; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.core.pac.DataFetcher; +import org.apache.linkis.monitor.core.scanner.AnomalyScanner; +import org.apache.linkis.monitor.core.scanner.DefaultScanner; +import org.apache.linkis.monitor.utils.alert.AlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.ImsAlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.MonitorAlertUtils; +import org.apache.linkis.monitor.utils.alert.ims.UserLabelAlertUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.Scheduled; @@ -50,14 +50,18 @@ import org.slf4j.Logger; /** - * * jobHistory monitor 1.errorCode: Monitor the error code 2.userLabel: tenant label monitoring, - * scan the execution data within the first 20 minutes, and judge the labels field of the data + * * jobHistory monitor + * 1.errorCode: Monitor the error code + * 2.userLabel: tenant label monitoring,scan the execution data within the first 20 minutes, and judge the labels field of the data + * * 3.jobResultRunTime: Scan the execution data within the first 20 minutes, and judge the completed * tasks. If the parm field in the jobhistory contains (task.notification.conditions) and the result * of executing the task is (Succeed, Failed, Canceled, Timeout, ALL) any one of them, an alarm is * triggered and the result of the job is that it has ended. All three are indispensable + * * 4.jobResultRunTimeForDSS: Scan the execution data within the first 20 minutes, scan the tasks * that have been marked for notification, if the task has ended, a notification will be initiated + * * 5.jobHistoryUnfinishedScan: monitor the status of the execution task, scan the data outside 12 * hours and within 24 hours */ @@ -68,14 +72,13 @@ public class JobHistoryMonitor { private static final Logger logger = LogUtils.stdOutLogger(); private static final long backtrackNum = 1000000L; - /** Scan tasks completed within 20 minutes */ - @Scheduled(cron = "0 0/10 * * * ?") + @Scheduled(cron = "${linkis.monitor.jobHistory.finished.cron}") public void jobHistoryFinishedScan() { - long intervalMs = 20 * 60 * 1000; // 20分钟 + long intervalMs = 20 * 60 * 1000; long maxIntervalMs = Constants.ERRORCODE_MAX_INTERVALS_SECONDS() * 1000; long endTime = System.currentTimeMillis(); long startTime = endTime - intervalMs; - long realIntervals = endTime - startTime < maxIntervalMs ? endTime - startTime : maxIntervalMs; + long realIntervals = Math.min(endTime - startTime, maxIntervalMs); AnomalyScanner scanner = new DefaultScanner(); boolean shouldStart = false; long id; @@ -91,7 +94,7 @@ public void jobHistoryFinishedScan() { id = CacheUtils.cacheBuilder.getIfPresent("jobHistoryId"); } List fetchers = generateFetchersfortime(startTime, endTime, id, "updated_time"); - if (fetchers == null) { + if (fetchers.isEmpty()) { logger.warn("generated 0 dataFetchers, plz check input"); return; } @@ -174,22 +177,21 @@ public void jobHistoryFinishedScan() { run(scanner, fetchers, shouldStart); } - /** * Whether scanning data within 12 hours has timed out */ - @Scheduled(cron = "${linkis.monitor.jobHistory.ScanTask.cron}") + @Scheduled(cron = "${linkis.monitor.jobHistory.timeout.cron}") public void jobHistoryUnfinishedScan() { long id = Optional.ofNullable(CacheUtils.cacheBuilder.getIfPresent("jobhistoryScan")) .orElse(MonitorConfig.JOB_HISTORY_TIME_EXCEED.getValue()); - long intervalMs = Constants.ERRORCODE_SCAN_INTERVALS_SECONDS() * 1000; + long intervalMs = Constants.TIMEOUT_INTERVALS_SECONDS() * 1000; long maxIntervalMs = Constants.ERRORCODE_MAX_INTERVALS_SECONDS() * 1000; long endTime = System.currentTimeMillis(); long startTime = endTime - intervalMs; - long realIntervals = endTime - startTime < maxIntervalMs ? endTime - startTime : maxIntervalMs; + long realIntervals = Math.min(endTime - startTime, maxIntervalMs); AnomalyScanner scanner = new DefaultScanner(); boolean shouldStart = false; List fetchers = generateFetchers(startTime, endTime, maxIntervalMs, id, "created_time"); - if (fetchers == null) { + if (fetchers.isEmpty()) { logger.warn("generated 0 dataFetchers, plz check input"); return; } @@ -215,7 +217,6 @@ public static void run(AnomalyScanner scanner, List fetchers, Boole if (shouldStart) { scanner.addDataFetchers(fetchers); scanner.run(); - // scanner.shutdown(); // wait all alert to be send } } @@ -225,15 +226,15 @@ private static List generateFetchers( long pe = endTime; long ps; while (pe > startTime) { - ps = pe - maxIntervalMs > startTime ? pe - maxIntervalMs : startTime; + ps = Math.max(pe - maxIntervalMs, startTime); String[] fetcherArgs = new String[] {String.valueOf(ps), String.valueOf(pe), String.valueOf(id), timeType}; ret.add(new JobHistoryDataFetcher(fetcherArgs, MapperFactory.getJobHistoryMapper())); logger.info( "Generated dataFetcher for startTime: " - + new Date(ps).toString() + + new Date(ps) + ". EndTime: " - + new Date(pe).toString()); + + new Date(pe)); pe = pe - maxIntervalMs; } return ret; @@ -249,9 +250,9 @@ private static List generateFetchersfortime( fetchers.add(new JobHistoryDataFetcher(fetcherArgs, MapperFactory.getJobHistoryMapper())); logger.info( "Generated dataFetcher for startTime: " - + new Date(startTime).toString() + + new Date(startTime) + ". EndTime: " - + new Date(endTime).toString()); + + new Date(endTime)); return fetchers; } diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ResourceMonitor.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/ResourceMonitor.java similarity index 90% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ResourceMonitor.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/ResourceMonitor.java index 459aaf70ff..0bc8fe7024 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/ResourceMonitor.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/ResourceMonitor.java @@ -15,16 +15,16 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; import org.apache.linkis.common.utils.ByteTimeUtils; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.entity.IndexEntity; -import org.apache.linkis.monitor.scan.app.monitor.until.HttpsUntils; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.utils.alert.AlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.MonitorAlertUtils; -import org.apache.linkis.monitor.scan.utils.alert.ims.PooledImsAlertUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.entity.IndexEntity; +import org.apache.linkis.monitor.until.HttpsUntils; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.utils.alert.AlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.MonitorAlertUtils; +import org.apache.linkis.monitor.utils.alert.ims.PooledImsAlertUtils; import org.apache.commons.collections.MapUtils; import org.apache.commons.lang3.StringUtils; @@ -48,7 +48,7 @@ public class ResourceMonitor { private static final Logger logger = LoggerFactory.getLogger(ResourceMonitor.class); - @Scheduled(cron = "${linkis.monitor.ecmResourceTask.cron}") + @Scheduled(cron = "${linkis.monitor.ecm.resource.cron}") public void ecmResourceTask() { Map resultmap = null; AtomicReference tenant = new AtomicReference<>("租户标签:公共资源"); @@ -105,12 +105,10 @@ public void ecmResourceTask() { if (((memorydouble) <= majorValue) || ((coresdouble) <= majorValue) || ((instancedouble) <= majorValue)) { - // major告警 major.add(emNodeVo.get("instance").toString()); } else if (((memorydouble) < minorValue) || ((coresdouble) < minorValue) || ((instancedouble) < minorValue)) { - // minor告警 minor.add(emNodeVo.get("instance").toString()); } HashMap replaceParm = new HashMap<>(); @@ -129,11 +127,9 @@ public void ecmResourceTask() { MonitorAlertUtils.getAlerts(Constants.ALERT_RESOURCE_MONITOR(), replaceParm); PooledImsAlertUtils.addAlert(ecmResourceAlerts.get("12003")); } - // ECM资源占比上报 resourceSendToIms( coresdouble, memorydouble, instancedouble, HttpsUntils.localHost, "USED"); }); - // ECM 剩余资源总数上报 resourceSendToIms( totalCores.get(), totalMemory.get(), totalInstance.get(), HttpsUntils.localHost, "TOTAL"); } diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskLogClear.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/TaskLogClear.java similarity index 87% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskLogClear.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/TaskLogClear.java index ae7e1bc21d..6def756982 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/TaskLogClear.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/TaskLogClear.java @@ -15,11 +15,11 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.ThreadUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.until.ThreadUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.annotation.PropertySource; import org.springframework.scheduling.annotation.Scheduled; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/UserModeMonitor.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/UserModeMonitor.java similarity index 94% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/UserModeMonitor.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/UserModeMonitor.java index c642a24762..e0a7f9f0af 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/scheduled/UserModeMonitor.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scheduled/UserModeMonitor.java @@ -15,18 +15,18 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.scheduled; +package org.apache.linkis.monitor.scheduled; import org.apache.linkis.common.utils.Utils; import org.apache.linkis.governance.common.entity.task.RequestPersistTask; import org.apache.linkis.httpclient.dws.config.DWSClientConfig; import org.apache.linkis.manager.label.constant.LabelKeyConstant; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.until.HttpsUntils; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.utils.alert.AlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.MonitorAlertUtils; -import org.apache.linkis.monitor.scan.utils.alert.ims.PooledImsAlertUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.until.HttpsUntils; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.utils.alert.AlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.MonitorAlertUtils; +import org.apache.linkis.monitor.utils.alert.ims.PooledImsAlertUtils; import org.apache.linkis.server.BDPJettyServerHelper; import org.apache.linkis.ujes.client.UJESClient; import org.apache.linkis.ujes.client.UJESClientImpl; @@ -60,7 +60,7 @@ public class UserModeMonitor { private static final UJESClient client = new UJESClientImpl(clientConfig); - @Scheduled(cron = "${linkis.monitor.user.cron}") + @Scheduled(cron = "${linkis.monitor.user.mode.cron}") public void job() { Optional.ofNullable(MonitorConfig.USER_MODE_ENGINE.getValue()) .ifPresent( diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/CacheUtils.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/CacheUtils.java similarity index 95% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/CacheUtils.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/CacheUtils.java index 258d81183c..a768fde555 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/CacheUtils.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/CacheUtils.java @@ -15,7 +15,7 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.until; +package org.apache.linkis.monitor.until; import java.util.concurrent.TimeUnit; diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/HttpsUntils.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/HttpsUntils.java similarity index 82% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/HttpsUntils.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/HttpsUntils.java index 34e12d175d..fd3f584b34 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/HttpsUntils.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/HttpsUntils.java @@ -15,22 +15,21 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.until; +package org.apache.linkis.monitor.until; import org.apache.linkis.common.conf.Configuration; import org.apache.linkis.common.utils.Utils; import org.apache.linkis.httpclient.dws.authentication.TokenAuthenticationStrategy; import org.apache.linkis.httpclient.dws.config.DWSClientConfig; import org.apache.linkis.httpclient.dws.config.DWSClientConfigBuilder; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.app.monitor.entity.ChatbotEntity; -import org.apache.linkis.monitor.scan.app.monitor.entity.IndexEntity; -import org.apache.linkis.monitor.scan.client.MonitorHTTPClient; -import org.apache.linkis.monitor.scan.client.MonitorHTTPClientClientImpl; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.request.EmsListAction; -import org.apache.linkis.monitor.scan.request.EntranceTaskAction; -import org.apache.linkis.monitor.scan.response.EntranceTaskResult; +import org.apache.linkis.monitor.entity.IndexEntity; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.client.MonitorHTTPClient; +import org.apache.linkis.monitor.client.MonitorHTTPClientClientImpl; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.request.EmsListAction; +import org.apache.linkis.monitor.request.EntranceTaskAction; +import org.apache.linkis.monitor.response.EntranceTaskResult; import org.apache.linkis.server.BDPJettyServerHelper; import org.apache.linkis.ujes.client.response.EmsListResult; @@ -169,18 +168,4 @@ public static void sendIndex(List list) throws IOException { logger.info("send index response :{}", map); Assert.isTrue(!"0".equals(map.get("resultCode")), map.get("resultMsg")); } - - public static void sendChatbot(ChatbotEntity chatbotEntity) throws IOException { - String json = BDPJettyServerHelper.gson().toJson(chatbotEntity); - StringEntity entity = - new StringEntity( - json, ContentType.create(ContentType.APPLICATION_JSON.getMimeType(), "UTF-8")); - entity.setContentEncoding("UTF-8"); - HttpPost httpPost = new HttpPost(MonitorConfig.CHATBOT_URL.getValue()); - httpPost.setConfig(RequestConfig.DEFAULT); - httpPost.setEntity(entity); - CloseableHttpResponse execute = HttpClients.createDefault().execute(httpPost); - String responseStr = EntityUtils.toString(execute.getEntity(), "UTF-8"); - Map map = BDPJettyServerHelper.gson().fromJson(responseStr, Map.class); - } } diff --git a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/ThreadUtils.java b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/ThreadUtils.java similarity index 80% rename from linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/ThreadUtils.java rename to linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/ThreadUtils.java index 5a099e7b65..15a2626379 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/scan/app/monitor/until/ThreadUtils.java +++ b/linkis-extensions/linkis-et-monitor/src/main/java/org/apache/linkis/monitor/until/ThreadUtils.java @@ -15,15 +15,15 @@ * limitations under the License. */ -package org.apache.linkis.monitor.scan.app.monitor.until; +package org.apache.linkis.monitor.until; import org.apache.linkis.common.utils.Utils; -import org.apache.linkis.monitor.scan.app.monitor.config.MonitorConfig; -import org.apache.linkis.monitor.scan.constants.Constants; -import org.apache.linkis.monitor.scan.utils.alert.AlertDesc; -import org.apache.linkis.monitor.scan.utils.alert.ims.MonitorAlertUtils; -import org.apache.linkis.monitor.scan.utils.alert.ims.PooledImsAlertUtils; -import org.apache.linkis.monitor.scan.utils.log.LogUtils; +import org.apache.linkis.monitor.config.MonitorConfig; +import org.apache.linkis.monitor.constants.Constants; +import org.apache.linkis.monitor.utils.alert.AlertDesc; +import org.apache.linkis.monitor.utils.alert.ims.MonitorAlertUtils; +import org.apache.linkis.monitor.utils.alert.ims.PooledImsAlertUtils; +import org.apache.linkis.monitor.utils.log.LogUtils; import org.springframework.context.ApplicationContext; import org.springframework.context.event.ApplicationContextEvent; @@ -53,8 +53,7 @@ public static String run(List cmdList, String shellName) { try { msg = future.get(MonitorConfig.SHELL_TIMEOUT.getValue(), TimeUnit.MINUTES).toString(); } catch (TimeoutException e) { - // 增加告警提示 - logger.info("超时告警 {}", shellName); + logger.info("execute shell time out {}", shellName); HashMap parms = new HashMap<>(); parms.put("$shellName", shellName); Map ecmResourceAlerts = diff --git a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InsLabelRelationMapper.xml b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InsLabelRelationMapper.xml index b9c1d19612..6c51f6d0aa 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InsLabelRelationMapper.xml +++ b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InsLabelRelationMapper.xml @@ -16,24 +16,24 @@ --> - - + + - + - + - + diff --git a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceInfoMapper.xml b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceInfoMapper.xml index c0ab7f2b22..d5309a5f04 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceInfoMapper.xml +++ b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceInfoMapper.xml @@ -16,9 +16,9 @@ --> - + - + diff --git a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceLabelMapper.xml b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceLabelMapper.xml index d92d999d47..e7c7558017 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceLabelMapper.xml +++ b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/InstanceLabelMapper.xml @@ -16,9 +16,9 @@ --> - + - + diff --git a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/JobHistoryMapper.xml b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/JobHistoryMapper.xml index 70d1f30158..730e8a43da 100644 --- a/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/JobHistoryMapper.xml +++ b/linkis-extensions/linkis-et-monitor/src/main/resources/mapper/common/JobHistoryMapper.xml @@ -18,9 +18,9 @@ - + - @@ -49,7 +49,7 @@