From 8c56d4af84ccc4dc6e2f2d2f159a7b73eeac91e7 Mon Sep 17 00:00:00 2001 From: oyo Date: Sat, 14 Sep 2024 15:02:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0agent?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/{{.packagePath}}/entrance/web/AppApplication.java | 5 ++++- .../entrance/web/src/main/resources/application.properties | 4 +++- template/pom.xml | 6 ++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java index 2c278b8..a54a448 100644 --- a/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java +++ b/template/entrance/web/src/main/java/{{.packagePath}}/entrance/web/AppApplication.java @@ -5,6 +5,7 @@ import com.vs.sqlmapper.spring.DataSourceConfig; import com.vs.sqlmapper.spring.scan.VSDaoBeanScan; import com.vs.mock.config.EnableVSMockConfiguration; import com.vs.sqlmapper.spring.express.EnableVSMockExpress; +import com.vs.agent.TocoAgentInitializer; import com.vs.debug.stack.agent.LogStackContextInvokeRecorder; import com.vs.debug.stack.agent.MethodVisitorHandlerFilter; @@ -43,6 +44,8 @@ public class AppApplication{ } public static void main(String[] args) { - SpringApplication.run(AppApplication.class,args); + SpringApplication application = new SpringApplication(AppApplication.class); + application.addInitializers(new TocoAgentInitializer()); + application.run(args); } } diff --git a/template/entrance/web/src/main/resources/application.properties b/template/entrance/web/src/main/resources/application.properties index fd5a2cb..5f41314 100644 --- a/template/entrance/web/src/main/resources/application.properties +++ b/template/entrance/web/src/main/resources/application.properties @@ -2,4 +2,6 @@ spring.profiles.active=local envs=local,remote,online,custom project_id=${projectId} -project_name={{ .artifactId }} \ No newline at end of file +project_name={{ .artifactId }} + +com.toco.agent.attach=true \ No newline at end of file diff --git a/template/pom.xml b/template/pom.xml index 71640a8..6409965 100644 --- a/template/pom.xml +++ b/template/pom.xml @@ -31,6 +31,7 @@ 1.0-SNAPSHOT 5.2.4 1.3.0-SNAPSHOT + 1.3.0-SNAPSHOT 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT 1.0.0-SNAPSHOT @@ -70,6 +71,11 @@ common-rpc ${vs.common.rpc.version} + + com.vs + common-agent + ${vs.common.agent.version} + {{- if eq .dbType "mysql" }} {{- else if eq .dbType "postgresql" }}