소스 검색

Fixed #TASK_QT-9810 Agent注入流程优化

Carl 1 년 전
부모
커밋
167e1e205e

+ 2 - 2
containers/apm_register_app.go

@@ -58,7 +58,7 @@ func (c *Container) RegisterAppInfo(r *Registry, pid uint32) error {
 			c.AppInfo.RegisterAt = time.Now().Unix()
 		}
 
-		if originAppName != "" && c.checkL7AttachReady() {
+		if originAppName != "" && c.Isl7AttachSuccess() {
 			klog.Infoln("[kprobe] reset kernel proc_info.")
 			err = r.tracer.InitKProcInfo(pid, &c.AppInfo)
 			if err != nil {
@@ -68,6 +68,6 @@ func (c *Container) RegisterAppInfo(r *Registry, pid uint32) error {
 			c.AppInfo.UpdateAt = time.Now().Unix()
 		}
 	}
-	c.AppInfo.AppSuccess()
+	c.AppInfo.SetAppSuccess()
 	return nil
 }

+ 2 - 2
containers/container.go

@@ -1378,7 +1378,7 @@ func (c *Container) revalidateListens(now time.Time, actualListens map[netaddr.I
 	}
 }
 
-func (c *Container) attachUprobes(tracer *ebpftracer.Tracer, pid uint32) error {
+func (c *Container) AttachUprobes(tracer *ebpftracer.Tracer, pid uint32) error {
 	klog.Infoln("[attach] attachUprobes start")
 	if tracer.DisableL7Tracing() {
 		return nil
@@ -1399,7 +1399,7 @@ func (c *Container) attachUprobes(tracer *ebpftracer.Tracer, pid uint32) error {
 		err = c.attachNetCoreUprobes(tracer, pid)
 	}
 	if err != nil {
-		c.DetachUprobes(pid, ERROR_DETACH)
+		c.DetachUprobes(pid, APP_UPROBE_ERROR)
 		return err
 	}
 	c.l7AttachSuccess()

+ 100 - 18
containers/container_apm.go

@@ -526,7 +526,7 @@ func (c *Container) eventReady() {
 }
 
 // uprobe前置
-func (c *Container) checkL7AttachReady() bool {
+func (c *Container) Isl7AttachSuccess() bool {
 	c.lock.Lock()
 	defer c.lock.Unlock()
 	return c.l7Attach
@@ -578,28 +578,31 @@ func (c *Container) verifyAttachConditions(r *Registry, pid uint32) (bool, int)
 }
 
 // 1.卸载入口
-func (c *Container) Detach(pid uint32, detachType int) {
+func (c *Container) Detach(pid uint32, detachType APP_TYPE) {
 	c.lock.Lock()
 	defer c.lock.Unlock()
 
 	if p := c.processes[pid]; p != nil {
 		err := c.DetachUprobes(pid, detachType)
 		if err != nil {
-			return
+			klog.WithError(err).Errorln("DetachUprobes Error.")
 		}
-		err = c.DetachStack(pid)
+		err = c.DetachStack(pid, detachType)
 		if err != nil {
-			return
+			klog.WithError(err).Errorln("DetachStack Error.")
 		}
 		// 关闭7层监控
 		c.l7Attach = false
-		// 变更应用为卸载状态
-		c.AppInfo.AppUninstall()
+		// 变更应用状态
+		if err != nil {
+			detachType = detachType.Error()
+		}
+		c.AppInfo.SetAppStatus(detachType)
 	}
 }
 
 // 1.1卸载uprobe
-func (c *Container) DetachUprobes(pid uint32, detachType int) error {
+func (c *Container) DetachUprobes(pid uint32, detachType APP_TYPE) error {
 	// close uprobe
 	if p := c.processes[pid]; p != nil {
 		for _, u := range p.uprobes {
@@ -610,7 +613,7 @@ func (c *Container) DetachUprobes(pid uint32, detachType int) error {
 		}
 		p.uprobes = []link.Link{}
 		switch detachType {
-		case UNINSTALL_DETACH:
+		case APP_UNINSTALL:
 			codeType := c.GetCodeTypeFromCache(pid)
 			switch codeType {
 			case CodeTypeJava:
@@ -621,7 +624,7 @@ func (c *Container) DetachUprobes(pid uint32, detachType int) error {
 			default:
 
 			}
-		case ERROR_DETACH:
+		case APP_UPROBE_ERROR:
 			klog.Infof("[DetachUprobes] ERROR_DETACH for pid %d", pid)
 		default:
 		}
@@ -632,11 +635,12 @@ func (c *Container) DetachUprobes(pid uint32, detachType int) error {
 }
 
 // 1.2卸载堆栈
-func (c *Container) DetachStack(pid uint32) error {
+func (c *Container) DetachStack(pid uint32, detachType APP_TYPE) error {
 	if p := c.processes[pid]; p != nil {
 		var err error
 		codeType := c.GetCodeTypeFromCache(pid)
 		switch codeType {
+		// 1.2.1 卸载 jvm堆栈
 		case CodeTypeJava:
 			err = c.detachJvmStack(pid)
 		default:
@@ -657,15 +661,15 @@ func (c *Container) DetachStack(pid uint32) error {
 func (c *Container) detachJvmStack(pid uint32) error {
 	if p := c.processes[pid]; p != nil {
 		var err error
+		// 卸载堆栈probes
+		err = p.closeStackUprobes()
+		klog.WithError(err).Infof("[detachJvmStack] closeStackUprobes")
+		//if p.stackStatus.IsStackUprobesSuccess() || len(p.stackUprobes) > 0 {
+		//}
+		// 卸载 JavaAgent
 		if p.stackStatus.IsJattachSuccess() {
-			// 卸载 JavaAgent
 			err = p.uninstallJavaAgent()
-			klog.WithError(err).Errorln("[detachJvmStack] uninstallJavaAgent")
-		}
-		if p.stackStatus.IsStackUprobesSuccess() || len(p.stackUprobes) > 0 {
-			// 卸载堆栈probes
-			err = p.closeStackUprobes()
-			klog.WithError(err).Errorln("[detachJvmStack] closeStackUprobes")
+			klog.WithError(err).Infof("[detachJvmStack] uninstallJavaAgent")
 		}
 		return err
 	}
@@ -678,3 +682,81 @@ func (c *Container) getRootfs() string {
 	}
 	return ""
 }
+
+func (c *Container) BuildActiveApps(runtimeApps map[uint32]AppStatusInfo, pid uint32) {
+	if c.AppInfo.AppName != "" {
+		detail := AppStatusInfo{
+			Pid:        pid,
+			ProcName:   c.containerName,
+			AppName:    c.AppInfo.AppName,
+			Language:   c.AppInfo.CodeType.String(),
+			AppID:      c.AppInfo.AppIdHash.IntVal,
+			AgentID:    c.AppInfo.AgentId,
+			InstanceID: c.AppInfo.InstanceIdHash.IntVal,
+			Sn:         c.AppInfo.Sn,
+			Sport:      c.AppInfo.Sport,
+			RegisterAt: time.Unix(c.AppInfo.RegisterAt, 0).Format("060102 15:04:05"),
+			PreStatus:  c.AppInfo.PreStatus,
+			Status:     c.AppInfo.Status,
+			Rule:       c.WhiteSettingInfo.Filters,
+		}
+		detail.Rule = fmt.Sprintf("%s|%d", c.WhiteSettingInfo.Filters, c.WhiteSettingInfo.OpenStack)
+		if c.AppInfo.UpdateAt != 0 {
+			detail.UpdateAt = time.Unix(c.AppInfo.UpdateAt, 0).Format("060102 15:04:05")
+		}
+		p := c.processes[pid]
+		if p != nil {
+			detail.StackStatus = p.stackStatus.String()
+		}
+		runtimeApps[pid] = detail
+	}
+
+}
+
+func (c *Container) AgentCtrl(r *Registry, pid uint32) {
+	var err error
+	verifyAttachConditions, openStack := c.verifyAttachConditions(r, pid)
+
+	// UNINSTALL
+	if r.isFusing && c.Isl7AttachSuccess() {
+		c.Detach(pid, APP_FUSE)
+		return
+	}
+
+	// verify UNINSTALL
+	if !verifyAttachConditions && c.Isl7AttachSuccess() {
+		c.Detach(pid, APP_UNINSTALL)
+		return
+	}
+
+	if verifyAttachConditions {
+		err = c.RegisterAppInfo(r, pid)
+		if err != nil {
+			klog.WithError(err).Errorf("[AgentCtrl] Failed registerAppInfo.")
+			return
+		}
+		klog.WithField("pid", pid).Infoln("[AgentCtrl] Attach uprobes.")
+		err = c.AttachUprobes(r.tracer, pid)
+		if err != nil {
+			klog.WithField("pid", pid).WithError(err).Errorf("[AgentCtrl] Failed attach uprobes error!")
+			return
+		} else {
+			klog.WithField("pid", pid).Infoln("[AgentCtrl] Attach uprobes success!")
+		}
+		if openStack == OPEN_STACK {
+			klog.WithField("pid", pid).Infoln("[AgentCtrl] Attach app stack.")
+			err = c.AttachStack(r.tracer, pid)
+			if err != nil {
+				c.AppInfo.SetAppStackError()
+				klog.WithField("pid", pid).WithError(err).Errorf("[AgentCtrl][end] Failed attach stack trace!")
+				return
+			}
+		} else {
+			// 关闭堆栈
+			err = c.DetachStack(pid, APP_UNINSTALL)
+			if err != nil {
+				klog.WithError(err).Errorf("[AgentCtrl][end] Failed detach stack trace!")
+			}
+		}
+	}
+}

+ 19 - 62
containers/registry.go

@@ -202,9 +202,17 @@ func (r *Registry) Close() {
 func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 	gcTicker := time.NewTicker(gcInterval)
 	defer gcTicker.Stop()
+	var fuseOnce bool
 	for {
 		select {
 		case now := <-gcTicker.C:
+			//_, err1 := os.Stat("/tmp/fuse")
+			//if err1 == nil {
+			//	r.isFusing = true
+			//} else {
+			//	r.isFusing = false
+			//}
+
 			//_, err := r.pullWhiteList()
 			_, err := r.pullWhiteListV2()
 			if err != nil {
@@ -212,66 +220,10 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 			}
 			runtimeApps := make(map[uint32]AppStatusInfo)
 			for pid, c := range r.containersByPid {
-				if c != nil {
-					if c != nil && !common.IsOpenFilter() {
-						verifyAttachConditions, openStack := c.verifyAttachConditions(r, pid)
-						if verifyAttachConditions && !r.isFusing {
-							err = c.RegisterAppInfo(r, pid)
-							if err == nil {
-								klog.WithField("pid", pid).Infoln("[registry] Attach uprobes.")
-								err = c.attachUprobes(r.tracer, pid)
-								if err != nil {
-									klog.WithField("pid", pid).WithError(err).Errorf("[registry] Failed attach uprobes error!")
-								} else {
-									klog.WithField("pid", pid).Infoln("[registry] Attach uprobes success!")
-								}
-								if openStack == OPEN_STACK {
-									klog.WithField("pid", pid).Infoln("[registry] Attach app stack.")
-									err = c.AttachStack(r.tracer, pid)
-									if err != nil {
-										klog.WithField("pid", pid).WithError(err).Errorf("[registry][end] Failed attach stack trace!")
-									}
-								} else {
-									// 未开启、成功、关闭、错误注入
-									// 关闭堆栈
-									err = c.DetachStack(pid)
-									if err != nil {
-										klog.WithError(err).Errorf("[registry][end] Failed detach stack trace!")
-									}
-								}
-							} else {
-								klog.WithError(err).Errorf("[registry] Failed registerAppInfo.")
-							}
-						}
-
-						if !verifyAttachConditions && c.checkL7AttachReady() {
-							// detach
-							c.Detach(pid, UNINSTALL_DETACH)
-						}
-					}
-					if c.AppInfo.AppName != "" {
-						detail := AppStatusInfo{
-							Pid:        pid,
-							ProcName:   c.containerName,
-							AppName:    c.AppInfo.AppName,
-							Language:   c.AppInfo.CodeType.String(),
-							AppID:      c.AppInfo.AppIdHash.IntVal,
-							AgentID:    c.AppInfo.AgentId,
-							InstanceID: c.AppInfo.InstanceIdHash.IntVal,
-							Sn:         c.AppInfo.Sn,
-							Sport:      c.AppInfo.Sport,
-							RegisterAt: time.Unix(c.AppInfo.RegisterAt, 0).Format("060102 15:04:05"),
-							Status:     c.AppInfo.Status,
-							Rule:       c.WhiteSettingInfo.Filters,
-						}
-						detail.Rule = fmt.Sprintf("%s|%d", c.WhiteSettingInfo.Filters, c.WhiteSettingInfo.OpenStack)
-						if c.AppInfo.UpdateAt != 0 {
-							detail.UpdateAt = time.Unix(c.AppInfo.UpdateAt, 0).Format("060102 15:04:05")
-						}
-
-						runtimeApps[pid] = detail
-					}
+				if c != nil && !common.IsOpenFilter() && !fuseOnce {
+					c.AgentCtrl(r, pid)
 				}
+				c.BuildActiveApps(runtimeApps, pid)
 
 				cg, err := proc.ReadCgroup(pid)
 				if err != nil {
@@ -287,6 +239,11 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 				}
 			}
 			saveAppInfo(runtimeApps)
+			if r.isFusing {
+				fuseOnce = true
+			} else {
+				fuseOnce = false
+			}
 
 			activeIPs := map[netaddr.IP]struct{}{}
 			for id, c := range r.containersById {
@@ -386,7 +343,7 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 							klog.WithError(err).Errorf("[registry] Failed registerAppInfo. pid is %d", e.Pid)
 							continue
 						}
-						c.attachUprobes(r.tracer, e.Pid)
+						c.AttachUprobes(r.tracer, e.Pid)
 						if !r.tracer.DisableStackTracing() {
 							err = c.AttachStack(r.tracer, e.Pid)
 							if err != nil {
@@ -421,7 +378,7 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 							klog.WithError(err).Errorf("[registry] Failed registerAppInfo. pid is %d", e.Pid)
 							continue
 						}
-						c.attachUprobes(r.tracer, e.Pid)
+						c.AttachUprobes(r.tracer, e.Pid)
 						// 禁用stack
 						if !r.tracer.DisableStackTracing() {
 							err = c.AttachStack(r.tracer, e.Pid)
@@ -468,7 +425,7 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 				}
 
 				if c := r.containersByPid[e.Pid]; c != nil {
-					//fmt.Println("EventTypeL7Request", e.Pid, c.checkL7AttachReady())
+					//fmt.Println("EventTypeL7Request", e.Pid, c.Isl7AttachSuccess())
 					//a, _ := json.Marshal(e.L7Request)
 					//fmt.Println("EventTypeL7Request", e.Pid, string(a))
 					fmt.Println("e---.L7Request Payload:", string(e.L7Request.Payload))

+ 0 - 311
dist/package_dir/agents/NativeAgent/lib/logs/20240925/server.log

@@ -1,311 +0,0 @@
-2024-09-25 09:26:19.712 [main] INFO  org.example.demoA.DemoAApplication - Starting DemoAApplication v1.0-SNAPSHOT on ubuntu2204 with PID 98387 (/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar started by root in /opt/cloudwise/smartagent/agent/NativeAgent/lib)
-2024-09-25 09:26:19.718 [main] INFO  org.example.demoA.DemoAApplication - No active profile set, falling back to default profiles: default
-2024-09-25 09:26:21.008 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
-2024-09-25 09:26:21.015 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
-2024-09-25 09:26:21.103 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 34ms. Found 0 Redis repository interfaces.
-2024-09-25 09:26:22.015 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 38081 (http)
-2024-09-25 09:26:22.036 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-38081"]
-2024-09-25 09:26:22.037 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
-2024-09-25 09:26:22.038 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.37]
-2024-09-25 09:26:22.169 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
-2024-09-25 09:26:22.170 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2318 ms
-2024-09-25 09:26:23.132 [main] WARN  org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'demoController': Unsatisfied dependency expressed through field 'demoAMySQLService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-2024-09-25 09:26:23.200 [main] INFO  org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener - 
-
-Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
-2024-09-25 09:26:23.207 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
-org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'demoController': Unsatisfied dependency expressed through field 'demoAMySQLService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
-	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
-	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
-	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
-	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
-	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
-	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
-	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
-	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
-	at org.example.demoA.DemoAApplication.main(DemoAApplication.java:15)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-	at java.lang.reflect.Method.invoke(Method.java:498)
-	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
-	at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
-	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
-	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
-Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1318)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1213)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
-	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
-	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
-	... 28 common frames omitted
-Caused by: java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java)
-	at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:668)
-	at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.<clinit>(AbandonedConnectionCleanupThread.java:80)
-	at java.lang.Class.forName0(Native Method)
-	at java.lang.Class.forName(Class.java:264)
-	at com.mysql.cj.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:98)
-	at java.lang.Class.forName0(Native Method)
-	at java.lang.Class.forName(Class.java:264)
-	at org.example.demoA.service.DemoAMySQLService.<clinit>(DemoAMySQLService.java:31)
-	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
-	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
-	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
-	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
-	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:204)
-	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1310)
-	... 39 common frames omitted
-2024-09-25 09:32:42.067 [main] INFO  org.example.demoA.DemoAApplication - Starting DemoAApplication v1.0-SNAPSHOT on ubuntu2204 with PID 98461 (/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar started by root in /opt/cloudwise/smartagent/agent/NativeAgent/lib)
-2024-09-25 09:32:42.076 [main] INFO  org.example.demoA.DemoAApplication - No active profile set, falling back to default profiles: default
-2024-09-25 09:32:43.374 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
-2024-09-25 09:32:43.383 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
-2024-09-25 09:32:43.475 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 37ms. Found 0 Redis repository interfaces.
-2024-09-25 09:32:44.521 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 38081 (http)
-2024-09-25 09:32:44.546 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-38081"]
-2024-09-25 09:32:44.547 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
-2024-09-25 09:32:44.548 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.37]
-2024-09-25 09:32:44.706 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
-2024-09-25 09:32:44.707 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2459 ms
-2024-09-25 09:32:45.739 [main] WARN  org.springframework.boot.web.servlet.context.AnnotationConfigServletWebServerApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'demoController': Unsatisfied dependency expressed through field 'demoAMySQLService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-2024-09-25 09:32:45.810 [main] INFO  org.springframework.boot.autoconfigure.logging.ConditionEvaluationReportLoggingListener - 
-
-Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
-2024-09-25 09:32:45.817 [main] ERROR org.springframework.boot.SpringApplication - Application run failed
-org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'demoController': Unsatisfied dependency expressed through field 'demoAMySQLService'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:643)
-	at org.springframework.beans.factory.annotation.InjectionMetadata.inject(InjectionMetadata.java:130)
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor.postProcessProperties(AutowiredAnnotationBeanPostProcessor.java:399)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1420)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:593)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
-	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897)
-	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
-	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
-	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
-	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
-	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
-	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
-	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
-	at org.example.demoA.DemoAApplication.main(DemoAApplication.java:15)
-	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
-	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
-	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
-	at java.lang.reflect.Method.invoke(Method.java:498)
-	at org.springframework.boot.loader.MainMethodRunner.run(MainMethodRunner.java:49)
-	at org.springframework.boot.loader.Launcher.launch(Launcher.java:109)
-	at org.springframework.boot.loader.Launcher.launch(Launcher.java:58)
-	at org.springframework.boot.loader.JarLauncher.main(JarLauncher.java:88)
-Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'demoAMySQLService' defined in URL [jar:file:/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar!/BOOT-INF/classes!/org/example/demoA/service/DemoAMySQLService.class]: Instantiation of bean failed; nested exception is java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1318)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1213)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:556)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
-	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
-	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
-	at org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1307)
-	at org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1227)
-	at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.inject(AutowiredAnnotationBeanPostProcessor.java:640)
-	... 28 common frames omitted
-Caused by: java.lang.NoClassDefFoundError: com/cloudwise/agent/core/config/AgentConfig
-	at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java)
-	at java.util.concurrent.Executors$DelegatedExecutorService.execute(Executors.java:668)
-	at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.<clinit>(AbandonedConnectionCleanupThread.java:80)
-	at java.lang.Class.forName0(Native Method)
-	at java.lang.Class.forName(Class.java:264)
-	at com.mysql.cj.jdbc.NonRegisteringDriver.<clinit>(NonRegisteringDriver.java:98)
-	at java.lang.Class.forName0(Native Method)
-	at java.lang.Class.forName(Class.java:264)
-	at org.example.demoA.service.DemoAMySQLService.<clinit>(DemoAMySQLService.java:31)
-	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
-	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
-	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
-	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
-	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:204)
-	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:87)
-	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:1310)
-	... 39 common frames omitted
-2024-09-25 10:17:36.410 [main] INFO  org.example.demoA.DemoAApplication - Starting DemoAApplication v1.0-SNAPSHOT on ubuntu2204 with PID 99049 (/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar started by root in /opt/cloudwise/smartagent/agent/NativeAgent/lib)
-2024-09-25 10:17:36.416 [main] INFO  org.example.demoA.DemoAApplication - No active profile set, falling back to default profiles: default
-2024-09-25 10:17:37.580 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
-2024-09-25 10:17:37.592 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
-2024-09-25 10:17:37.678 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 35ms. Found 0 Redis repository interfaces.
-2024-09-25 10:17:38.554 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 38081 (http)
-2024-09-25 10:17:38.578 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-38081"]
-2024-09-25 10:17:38.579 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
-2024-09-25 10:17:38.579 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.37]
-2024-09-25 10:17:38.713 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
-2024-09-25 10:17:38.713 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2171 ms
-2024-09-25 10:17:40.225 [main] INFO  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor'
-2024-09-25 10:17:40.706 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-38081"]
-2024-09-25 10:17:40.752 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 38081 (http) with context path ''
-2024-09-25 10:17:40.775 [main] INFO  org.example.demoA.DemoAApplication - Started DemoAApplication in 5.613 seconds (JVM running for 8.686)
-2024-09-25 10:18:05.109 [http-nio-38081-exec-1] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
-2024-09-25 10:18:05.110 [http-nio-38081-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
-2024-09-25 10:18:05.126 [http-nio-38081-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Completed initialization in 15 ms
-2024-09-25 10:18:05.203 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:18:05.203 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:18:06.092 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:18:06.121 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:18:06.152 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:18:06.154 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:18:06.988 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:18:06.989 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:18:06.998 [http-nio-38081-exec-2] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:18:06 UTC 2024
-2024-09-25 10:18:07.093 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:18:06 UTC 2024
-2024-09-25 10:18:07.093 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:18:07.094 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:18:07.195 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:19:56.903 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:19:56.903 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:19:57.206 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:19:57.232 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:19:57.258 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:19:57.259 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:19:57.340 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:19:57.341 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:19:57.345 [http-nio-38081-exec-5] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:19:57 UTC 2024
-2024-09-25 10:19:57.351 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:19:57 UTC 2024
-2024-09-25 10:19:57.355 [http-nio-38081-exec-4] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:19:57.355 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:19:57.456 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:25:33.563 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:25:33.564 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:25:33.850 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:25:33.884 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:25:33.919 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:25:33.920 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:25:34.041 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:25:34.041 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:25:34.048 [http-nio-38081-exec-9] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:25:34 UTC 2024
-2024-09-25 10:25:34.052 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:25:34 UTC 2024
-2024-09-25 10:25:34.052 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:25:34.053 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:25:34.153 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:28:34.303 [SpringContextShutdownHook] INFO  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'
-2024-09-25 10:28:47.629 [main] INFO  org.example.demoA.DemoAApplication - Starting DemoAApplication v1.0-SNAPSHOT on ubuntu2204 with PID 99355 (/opt/cloudwise/Demo-A-1.0-SNAPSHOT.jar started by root in /opt/cloudwise/smartagent/agent/NativeAgent/lib)
-2024-09-25 10:28:47.635 [main] INFO  org.example.demoA.DemoAApplication - No active profile set, falling back to default profiles: default
-2024-09-25 10:28:48.993 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode!
-2024-09-25 10:28:48.999 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
-2024-09-25 10:28:49.067 [main] INFO  org.springframework.data.repository.config.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 33ms. Found 0 Redis repository interfaces.
-2024-09-25 10:28:49.955 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat initialized with port(s): 38081 (http)
-2024-09-25 10:28:49.979 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-38081"]
-2024-09-25 10:28:49.981 [main] INFO  org.apache.catalina.core.StandardService - Starting service [Tomcat]
-2024-09-25 10:28:49.982 [main] INFO  org.apache.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/9.0.37]
-2024-09-25 10:28:50.110 [main] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring embedded WebApplicationContext
-2024-09-25 10:28:50.111 [main] INFO  org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2362 ms
-2024-09-25 10:28:51.608 [main] INFO  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Initializing ExecutorService 'applicationTaskExecutor'
-2024-09-25 10:28:52.115 [main] INFO  org.apache.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-38081"]
-2024-09-25 10:28:52.195 [main] INFO  org.springframework.boot.web.embedded.tomcat.TomcatWebServer - Tomcat started on port(s): 38081 (http) with context path ''
-2024-09-25 10:28:52.215 [main] INFO  org.example.demoA.DemoAApplication - Started DemoAApplication in 6.108 seconds (JVM running for 10.423)
-2024-09-25 10:32:48.936 [http-nio-38081-exec-1] INFO  org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/] - Initializing Spring DispatcherServlet 'dispatcherServlet'
-2024-09-25 10:32:48.937 [http-nio-38081-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
-2024-09-25 10:32:48.955 [http-nio-38081-exec-1] INFO  org.springframework.web.servlet.DispatcherServlet - Completed initialization in 17 ms
-2024-09-25 10:32:49.027 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:32:49.029 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:32:49.883 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:32:49.913 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:32:49.944 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:32:49.950 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:32:50.723 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:32:50.724 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:32:50.735 [http-nio-38081-exec-2] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:32:50 UTC 2024
-2024-09-25 10:32:50.779 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:32:50 UTC 2024
-2024-09-25 10:32:50.779 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:32:50.780 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:32:50.881 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:33:10.804 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:33:10.805 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:33:11.103 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:33:11.131 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:33:11.160 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:33:11.161 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:33:11.244 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:33:11.245 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:33:11.249 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:33:11 UTC 2024
-2024-09-25 10:33:11.252 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:33:11 UTC 2024
-2024-09-25 10:33:11.253 [http-nio-38081-exec-3] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:33:11.253 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:33:11.353 [http-nio-38081-exec-3] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:33:22.565 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:33:22.566 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:33:22.835 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:33:22.861 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:33:22.890 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:33:22.890 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:33:22.973 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:33:22.973 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:33:22.978 [http-nio-38081-exec-5] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:33:22 UTC 2024
-2024-09-25 10:33:22.982 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:33:22 UTC 2024
-2024-09-25 10:33:22.984 [http-nio-38081-exec-6] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:33:22.984 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:33:23.085 [http-nio-38081-exec-6] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:31.268 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:31.269 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:43:31.544 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:43:31.574 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:43:31.609 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:43:31.612 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:43:31.693 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:43:31.694 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:31.697 [http-nio-38081-exec-9] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:43:31 UTC 2024
-2024-09-25 10:43:31.701 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:43:31 UTC 2024
-2024-09-25 10:43:31.702 [http-nio-38081-exec-8] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:31.702 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:43:31.803 [http-nio-38081-exec-8] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:33.460 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:33.460 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:43:33.758 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:43:33.789 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:43:33.813 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:43:33.814 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:43:33.905 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:43:33.906 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:33.909 [http-nio-38081-exec-2] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:43:33 UTC 2024
-2024-09-25 10:43:33.912 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:43:33 UTC 2024
-2024-09-25 10:43:33.912 [http-nio-38081-exec-10] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:33.912 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:43:34.012 [http-nio-38081-exec-10] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:38.463 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:43:38.463 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - model :normal
-2024-09-25 10:43:38.709 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - select count(*) from tb_user: 0
-2024-09-25 10:43:38.740 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i1 = 0
-2024-09-25 10:43:38.768 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoAMySQLService - i3 = 0
-2024-09-25 10:43:38.770 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute mysql success.....
-2024-09-25 10:43:38.856 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - execute redis success.....delete,set,get,get value is value2-string 
-2024-09-25 10:43:38.856 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - begin  out : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:38.858 [http-nio-38081-exec-4] INFO  org.example.demoA.controller.ServerLogController - hello2 .....Wed Sep 25 10:43:38 UTC 2024
-2024-09-25 10:43:38.862 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - http://127.0.0.1:38081/hello2 response : hello2 success at Wed Sep 25 10:43:38 UTC 2024
-2024-09-25 10:43:38.862 [http-nio-38081-exec-1] INFO  org.example.demoA.service.DemoOutService - out success : http://127.0.0.1:38081/hello2
-2024-09-25 10:43:38.862 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - 应用「demoA」测试简单LogBack--Info级别日志--normalTest
-2024-09-25 10:43:38.963 [http-nio-38081-exec-1] INFO  org.example.demoA.controller.ServerLogController - -------------------------------
-2024-09-25 10:44:13.430 [SpringContextShutdownHook] INFO  org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor - Shutting down ExecutorService 'applicationTaskExecutor'

+ 10 - 6
flags/flags.go

@@ -167,8 +167,10 @@ func DumpTableFeatures() {
 	}
 	t := table.NewWriter()
 	for pid, info := range s {
-		service := fmt.Sprintf("%s:%d", info.Sn, info.Sport)
+		service := fmt.Sprintf("%s", info.Sn)
 		t.AppendRow(table.Row{
+			//info.AgentID,
+			//info.UpdateAt,
 			pid,
 			info.ProcName,
 			info.AppName,
@@ -176,14 +178,16 @@ func DumpTableFeatures() {
 			info.Language,
 			service,
 			info.AppID,
-			//info.AgentID,
 			info.RegisterAt,
-			info.UpdateAt,
+			info.PreStatus.String(),
 			info.Status.String(),
+			info.StackStatus,
 		})
 	}
 	t.SetAutoIndex(true)
 	t.AppendHeader(table.Row{
+		//"agent id",
+		//"update at",
 		"pid",
 		"process",
 		"app name",
@@ -191,10 +195,10 @@ func DumpTableFeatures() {
 		"code",
 		"service",
 		"app id",
-		//"agent id",
-		"first register at",
-		"update at",
+		"reg at",
+		"app pre status",
 		"app status",
+		"stack status",
 	})
 	fmt.Println(t.Render())
 	os.Exit(0)

+ 54 - 7
utils/modelse/app_info.go

@@ -14,17 +14,55 @@ type APP_TYPE int
 const (
 	APP_WAIT APP_TYPE = iota
 	APP_SUCCESS
+	APP_UPROBE_ERROR
+	APP_STACK_ERROR
 	APP_UNINSTALL
+	APP_UNINSTALL_ERROR
+	APP_FUSE
+	APP_FUSE_ERROR
 )
 
+func (s APP_TYPE) Error() APP_TYPE {
+	switch s {
+	case APP_UNINSTALL:
+		return APP_UNINSTALL_ERROR
+	case APP_FUSE:
+		return APP_FUSE_ERROR
+	default:
+		return APP_UPROBE_ERROR
+	}
+}
+func (s APP_TYPE) IsSuccess() bool {
+	if s == APP_SUCCESS {
+		return true
+	}
+	return false
+}
+
+func (s APP_TYPE) IsError() bool {
+	switch s {
+	case APP_UNINSTALL_ERROR:
+	case APP_FUSE_ERROR:
+	case APP_UPROBE_ERROR:
+		return true
+	default:
+		return false
+	}
+	return false
+}
+
 func (s APP_TYPE) String() string {
 	switch s {
 	case APP_SUCCESS:
 		return "SUCCESS"
+	case APP_UPROBE_ERROR:
+		return "UPROBE ERROR"
 	case APP_UNINSTALL:
 		return "UNINSTALL"
+	case APP_FUSE:
+		return "FUSE"
 	default:
-		return "APP_WAIT"
+		return "-"
 	}
 }
 
@@ -40,6 +78,7 @@ type AppInfo struct {
 	EBPFProcInfo   *EbpfProcInfo `json:"ebpf_proc_info"`
 	RegisterAt     int64         `json:"register_at"`
 	UpdateAt       int64         `json:"update_at"`
+	PreStatus      APP_TYPE      `json:"pre_status"`
 	Status         APP_TYPE      `json:"status"`
 	Version        string        `json:"version"`
 }
@@ -48,14 +87,22 @@ func (a *AppInfo) UpdateAtTime() {
 	a.UpdateAt = time.Now().Unix()
 }
 
-func (a *AppInfo) AppSuccess() {
-	if a.Status != APP_SUCCESS {
-		a.Status = APP_SUCCESS
-		a.UpdateAtTime()
+func (a *AppInfo) SetAppStatus(status APP_TYPE) {
+	a.PreStatus = a.Status
+	a.Status = status
+	a.UpdateAtTime()
+}
+
+func (a *AppInfo) SetAppSuccess() {
+	if !a.Status.IsSuccess() {
+		a.SetAppStatus(APP_SUCCESS)
 	}
 }
 
+func (a *AppInfo) SetAppStackError() {
+	a.SetAppStatus(APP_STACK_ERROR)
+}
+
 func (a *AppInfo) AppUninstall() {
-	a.Status = APP_UNINSTALL
-	a.UpdateAtTime()
+	a.SetAppStatus(APP_UNINSTALL)
 }

+ 1 - 1
utils/modelse/stack_status.go

@@ -46,6 +46,6 @@ func (s *StackStatus) StackUprobesClose() {
 }
 
 func (s StackStatus) String() string {
-	return fmt.Sprintf("Jattach: %v, StackUprobes: %v",
+	return fmt.Sprintf("native:%v|uprobe:%v",
 		s.IsJattachSuccess(), s.IsStackUprobesSuccess())
 }

+ 15 - 14
utils/modelse/status.go

@@ -3,20 +3,21 @@ package modelse
 var RuntimeApps map[uint32]AppStatusInfo
 
 type AppStatusInfo struct {
-	Pid        uint32   `json:"pid"`
-	ProcName   string   `json:"proc_name"`
-	AppName    string   `json:"app_name"`
-	Language   string   `json:"language"`
-	AppID      int64    `json:"app_id"`
-	AgentID    int64    `json:"agent_id,omitempty"`
-	InstanceID int64    `json:"instance_id,omitempty"`
-	Sn         string   `json:"sn"`
-	Sport      int      `json:"sport"`
-	RegisterAt string   `json:"register_at"`
-	UpdateAt   string   `json:"update_at"`
-	Status     APP_TYPE `json:"status"`
-	Rule       string   `json:"rule"`
-	OpenStack  bool     `json:"openstack"`
+	Pid         uint32   `json:"pid"`
+	ProcName    string   `json:"proc_name"`
+	AppName     string   `json:"app_name"`
+	Language    string   `json:"language"`
+	AppID       int64    `json:"app_id"`
+	AgentID     int64    `json:"agent_id,omitempty"`
+	InstanceID  int64    `json:"instance_id,omitempty"`
+	Sn          string   `json:"sn"`
+	Sport       int      `json:"sport"`
+	RegisterAt  string   `json:"register_at"`
+	UpdateAt    string   `json:"update_at"`
+	Status      APP_TYPE `json:"status"`
+	PreStatus   APP_TYPE `json:"pre_status"`
+	Rule        string   `json:"rule"`
+	StackStatus string   `json:"stack_status"`
 }
 
 const (