From 96145bfab0d402fd327be1b4f8e3b6e87d646b82 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Mon, 18 Sep 2023 16:12:39 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=E6=9C=AC=E5=9C=B0debug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/console/impl/AbstractTaskRunService.java | 2 +- .../src/main/resources/application.properties | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java b/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java index 0f2ed77..8c506c8 100644 --- a/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java +++ b/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java @@ -207,7 +207,7 @@ public MoonBoxResult taskRun(TaskRunReq taskRunReq) { MoonBoxLogVO.MoonBoxLogVOBuilder builder = MoonBoxLogVO.builder().taskRunId(taskRunInfo.getTaskRunId()); MoonBoxResult returnResult = null; try { - String result =agentDistributionService.startAgent(dbTaskRunInfo); + String result = agentDistributionService.startAgent(dbTaskRunInfo); dbUpdate.setRunStatus(TaskRunStatus.RUNNING.getCode()); builder.content("agent启动执行结果:"+result); returnResult = MoonBoxResult.createSuccess(); diff --git a/moonbox-server/moonbox-web/src/main/resources/application.properties b/moonbox-server/moonbox-web/src/main/resources/application.properties index 4c5d7e6..2642d2d 100644 --- a/moonbox-server/moonbox-web/src/main/resources/application.properties +++ b/moonbox-server/moonbox-web/src/main/resources/application.properties @@ -1,9 +1,9 @@ spring.main.allow-bean-definition-overriding=true #mysql -spring.datasource.url=jdbc:mysql://127.0.0.1:3306/repeater_console?&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true -spring.datasource.username=yyy -spring.datasource.password=xxx +spring.datasource.url=jdbc:mysql://10.11.12.46:3306/repeater_console?&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true +spring.datasource.username=yzjadmin +spring.datasource.password=kingdee spring.datasource.driver-class-name=org.mariadb.jdbc.Driver mybatis.mapper-locations=classpath*:META-INF/mybatis/mapper/*.xml mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml @@ -11,9 +11,9 @@ mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml moonbox.server.url=http://127.0.0.1:8080 -config.elasticsearch.nodes=127.0.0.1:9200,127.0.0.1:9200 -config.elasticsearch.username=user -config.elasticsearch.password=pwd +config.elasticsearch.nodes=10.11.12.54:9740,10.11.12.55:9740 +config.elasticsearch.username=esreadonly +config.elasticsearch.password=yzjdev@2011 app.name=moonbox-web sandbox.agent.download.uri=/api/agent/downLoadSandBoxZipFile From 5c89c22b70a0c2d30677240c9d46596863be1e65 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 10:01:35 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=AE=8C=E5=96=84user-guide=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E7=A4=BE=E5=8C=BA=E7=BE=A4=E9=AB=98=E9=A2=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=81=9A=E7=89=B9=E6=AE=8A=E8=AF=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/user-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/user-guide.md b/docs/user-guide.md index 242eba8..103b688 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -62,6 +62,10 @@ 任务运行时长:录制任务运行时长,超过该时长后,录制任务为自动关闭 +**很多同学对上面的"应用名称"和"jvm参数标识"表示疑惑,并且社区群里不断有人问我到底该怎么填。应用名称这里建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心读取。 +这里的"jvm启动参数标识"不做强制约定的,本质上是为了使用"ps aux | grep $app_name"这样的shell快速匹配到指定的pid,进而方便agent attach到指定的pid进行录制/回放。 +如果你实在不明白怎么定义这个启动参数,可以在目标应用启动脚本中使用类似"-DappName=item-center",这里的item-center就是目标应用名/服务名** + #### 流量采集配置 录制的流量类型,目前平台支持 http接口,dubbo接口和java方法的录制。 From 93dfd9444372c6d90d0bf6aa4e212bd4c43dd128 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 10:03:46 +0800 Subject: [PATCH 3/8] =?UTF-8?q?=E5=AE=8C=E5=96=84user-guide=EF=BC=8C?= =?UTF-8?q?=E5=AF=B9=E7=A4=BE=E5=8C=BA=E7=BE=A4=E9=AB=98=E9=A2=91=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E5=81=9A=E7=89=B9=E6=AE=8A=E8=AF=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/user-guide.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/user-guide.md b/docs/user-guide.md index 103b688..4247e9b 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -84,6 +84,10 @@ *接口方法:* 支持正则表达式。采集某个具体方法名:testRecord、采集所有方法:.* +##### motan接口 + +同上,参考dubbo + ##### java方法录制 java方法录制比较特殊,由于是依托于spring实现,因此有如下限制: From 72398ca5457c6f9e3797dffc8a3c4b35c8a4dc57 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 10:57:53 +0800 Subject: [PATCH 4/8] =?UTF-8?q?=E8=84=B1=E6=95=8F=E9=85=8D=E7=BD=AE?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/resources/application.properties | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/moonbox-server/moonbox-web/src/main/resources/application.properties b/moonbox-server/moonbox-web/src/main/resources/application.properties index 2642d2d..b4d28d7 100644 --- a/moonbox-server/moonbox-web/src/main/resources/application.properties +++ b/moonbox-server/moonbox-web/src/main/resources/application.properties @@ -1,9 +1,9 @@ spring.main.allow-bean-definition-overriding=true #mysql -spring.datasource.url=jdbc:mysql://10.11.12.46:3306/repeater_console?&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true -spring.datasource.username=yzjadmin -spring.datasource.password=kingdee +spring.datasource.url=jdbc:mysql://127.0.0.1:3306/repeater_console?&characterEncoding=UTF-8&autoReconnect=true&allowMultiQueries=true +spring.datasource.username= +spring.datasource.password= spring.datasource.driver-class-name=org.mariadb.jdbc.Driver mybatis.mapper-locations=classpath*:META-INF/mybatis/mapper/*.xml mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml @@ -11,9 +11,9 @@ mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml moonbox.server.url=http://127.0.0.1:8080 -config.elasticsearch.nodes=10.11.12.54:9740,10.11.12.55:9740 -config.elasticsearch.username=esreadonly -config.elasticsearch.password=yzjdev@2011 +config.elasticsearch.nodes=127.0.0.1:9740 +config.elasticsearch.username= +config.elasticsearch.password= app.name=moonbox-web sandbox.agent.download.uri=/api/agent/downLoadSandBoxZipFile From 2c7786ca58ce534a955f46306d2120f74862ec1c Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 11:00:30 +0800 Subject: [PATCH 5/8] =?UTF-8?q?=E8=A7=A3=E5=86=B3=E8=AF=AF=E6=8F=90?= =?UTF-8?q?=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/console/impl/AbstractTaskRunService.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java b/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java index 8c506c8..b48e9db 100644 --- a/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java +++ b/moonbox-server/moonbox-service-console/src/main/java/com/vivo/internet/moonbox/service/console/impl/AbstractTaskRunService.java @@ -115,7 +115,7 @@ public abstract class AbstractTaskRunService implements TaskRunService { @Override public void deleteByPkId(String taskRunId) { - TaskRunInfoWithBLOBs taskRunInfoWithBLOBs =getByTaskRunId(taskRunId); + TaskRunInfoWithBLOBs taskRunInfoWithBLOBs = getByTaskRunId(taskRunId); TaskRunInfoWithBLOBs taskRunInfo = new TaskRunInfoWithBLOBs(); taskRunInfo.setDeleteState(DeleteStatus.DELETED.getStatus()); taskRunInfo.setId(taskRunInfoWithBLOBs.getId()); @@ -209,7 +209,7 @@ public MoonBoxResult taskRun(TaskRunReq taskRunReq) { try { String result = agentDistributionService.startAgent(dbTaskRunInfo); dbUpdate.setRunStatus(TaskRunStatus.RUNNING.getCode()); - builder.content("agent启动执行结果:"+result); + builder.content("agent启动执行结果:" + result); returnResult = MoonBoxResult.createSuccess(); } catch (Exception e) { dbUpdate.setRunStatus(TaskRunStatus.FAILED.getCode()); @@ -230,7 +230,7 @@ public MoonBoxResult reRun(String taskRunId, String runUser, ReRunType reR @Override public void stop(String taskRunId, String runUser) { - TaskRunInfoWithBLOBs taskRunInfoWithBLOBs =getByTaskRunId(taskRunId); + TaskRunInfoWithBLOBs taskRunInfoWithBLOBs = getByTaskRunId(taskRunId); TaskRunInfoWithBLOBs update = new TaskRunInfoWithBLOBs(); update.setRunStatus(TaskRunStatus.STOP_RUN.getCode()); update.setUpdateUser(runUser); @@ -250,7 +250,7 @@ TaskRunInfoWithBLOBs getByTaskRunId(String taskRunId) { TaskRunInfoExample taskRunInfoExample = new TaskRunInfoExample(); taskRunInfoExample.createCriteria().andTaskRunIdEqualTo(taskRunId); List taskRunInfo = taskRunInfoMapper.selectByExampleWithBLOBs(taskRunInfoExample); - AssertUtil.assetTrue(taskRunInfo.size() >0,"没有找到任务,任务id:"+taskRunId); + AssertUtil.assetTrue(taskRunInfo.size() > 0, "没有找到任务,任务id:" + taskRunId); return taskRunInfo.get(0); } From f922fa092870e6ceff1297990681bef5856a3d14 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 11:14:47 +0800 Subject: [PATCH 6/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/user-guide.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index 4247e9b..48d55c0 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -62,9 +62,10 @@ 任务运行时长:录制任务运行时长,超过该时长后,录制任务为自动关闭 -**很多同学对上面的"应用名称"和"jvm参数标识"表示疑惑,并且社区群里不断有人问我到底该怎么填。应用名称这里建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心读取。 -这里的"jvm启动参数标识"不做强制约定的,本质上是为了使用"ps aux | grep $app_name"这样的shell快速匹配到指定的pid,进而方便agent attach到指定的pid进行录制/回放。 -如果你实在不明白怎么定义这个启动参数,可以在目标应用启动脚本中使用类似"-DappName=item-center",这里的item-center就是目标应用名/服务名** +**很多同学对上面的"应用名称"和"jvm参数标识"表示疑惑,这里做统一说明:** +- 为了演示方便,**"应用名称"** 下拉列表对应的接口数据是硬编码实现的。生产使用时建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心等中读取数据。 +- **"jvm启动参数标识"** 是未做强制规范约定的,建议在目标应用启动脚本中使用类似"-DappName=item-center"(item-center是目标应用名/服务名)。 +- 上述二者必须对应,否则可能会导致agent无法正确匹配和附加到目标应用的进程 #### 流量采集配置 From 82ac0fb217948735662abac324605cf12f9efa26 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 13:27:23 +0800 Subject: [PATCH 7/8] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/user-guide.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docs/user-guide.md b/docs/user-guide.md index 48d55c0..d177013 100644 --- a/docs/user-guide.md +++ b/docs/user-guide.md @@ -56,16 +56,15 @@ ![1669969036417](./images/guide/1669969036417.png) -*应用名称:* server端接口 /api/app/appNameList 返回,server部署前需修改为用户自身应用标识。需要注意的是,**jvm参数需包含该应用标识**,否则”远程录制“方式无法启动 +应用名称: server端接口 /api/app/appNameList 返回,server部署前需修改为用户自身应用标识。需要注意的是,**jvm参数需包含该应用标识**,否则”远程录制“方式无法启动 单接口采集量:单个接口的最大采集量 任务运行时长:录制任务运行时长,超过该时长后,录制任务为自动关闭 -**很多同学对上面的"应用名称"和"jvm参数标识"表示疑惑,这里做统一说明:** -- 为了演示方便,**"应用名称"** 下拉列表对应的接口数据是硬编码实现的。生产使用时建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心等中读取数据。 +**很多新手朋友对上面的"应用名称"和"jvm参数标识"表示疑惑,不知道如何配置和使用,补充说明如下:** +- 为了演示方便,**"应用名称"** 下拉列表对应的数据默认是在接口中硬编码实现的。生产使用时建议自行扩展,可以考虑从数据库、CMDB、注册中心/配置中心等中读取数据; - **"jvm启动参数标识"** 是未做强制规范约定的,建议在目标应用启动脚本中使用类似"-DappName=item-center"(item-center是目标应用名/服务名)。 -- 上述二者必须对应,否则可能会导致agent无法正确匹配和附加到目标应用的进程 #### 流量采集配置 From b8b17dfb7545bf26b54ffe3f18302aa0d7ccfcf5 Mon Sep 17 00:00:00 2001 From: coderDylan <771021218@qq.com> Date: Wed, 29 Nov 2023 14:06:46 +0800 Subject: [PATCH 8/8] fix ci --- .../moonbox-web/src/main/resources/application.properties | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moonbox-server/moonbox-web/src/main/resources/application.properties b/moonbox-server/moonbox-web/src/main/resources/application.properties index b4d28d7..1ed54a0 100644 --- a/moonbox-server/moonbox-web/src/main/resources/application.properties +++ b/moonbox-server/moonbox-web/src/main/resources/application.properties @@ -11,9 +11,12 @@ mybatis.config-location=classpath:META-INF/mybatis/mybatis-config.xml moonbox.server.url=http://127.0.0.1:8080 + +#es start config.elasticsearch.nodes=127.0.0.1:9740 config.elasticsearch.username= config.elasticsearch.password= +#es end app.name=moonbox-web sandbox.agent.download.uri=/api/agent/downLoadSandBoxZipFile