Parcourir la source

Feature #TASK_QT-21111 【私有发版v8.5】Euspace 日志简化&日志级别默认设置为error

Tom il y a 1 an
Parent
commit
926c2efcac

+ 1 - 1
containers/apm_get_code_setting.go

@@ -18,7 +18,7 @@ func (c *Container) GetCodeSetting(r *Registry) (CodeSettingResp, error) {
 		Appid:     c.AppInfo.AppIdHash.IntVal,
 		AgentId:   c.AppInfo.AgentId,
 	}
-	klog.Infof("[GetCodeSetting] req: %s.", utils.ToString(req))
+	//klog.Infof("[GetCodeSetting] req: %s.", utils.ToString(req))
 	resp, err := r.connServer.GetCodeSetting(req)
 	if err != nil {
 		klog.WithError(err).Errorf("[GetCodeSetting] Failed GetCodeSetting  %s.", utils.ToString(req))

+ 3 - 2
containers/apm_register_app.go

@@ -41,7 +41,7 @@ func (c *Container) RegisterAppInfo(r *Registry, pid uint32) error {
 			return fmt.Errorf("[%sregister app] Unknown node info.", cl)
 		}
 		// if reRegFlag {
-			c.ReBuildIds(pid)
+		c.ReBuildIds(pid)
 		// }
 		registerAppReq := RegisterAppReq{
 			AppId:       c.AppInfo.AppIdHash.IntVal,
@@ -56,7 +56,8 @@ func (c *Container) RegisterAppInfo(r *Registry, pid uint32) error {
 			App_type:    1,
 			AppLang:     "ebpf",
 		}
-		klog.Infof("[%sregister app] Register App req: %s.", cl, registerAppReq.String())
+		//klog.Infof("[%sregister app] Register App req: %s.", cl, registerAppReq.String())
+		klog.Infof("[%sregister app] Register App", cl)
 		err = r.connServer.RegisterApp(registerAppReq)
 		if err != nil {
 			klog.WithError(err).Errorf("[%sregister app] Failed Register App %s.", cl, registerAppReq.String())

+ 8 - 7
containers/apm_stack_dispatch.go

@@ -16,7 +16,6 @@ import (
 	"golang.org/x/arch/arm64/arm64asm"
 	"golang.org/x/arch/x86/x86asm"
 	"io"
-	"log"
 	"os"
 	"regexp"
 	"sort"
@@ -183,12 +182,12 @@ func (c *Container) getJavaAOTUprobes(binType, path string, dbgpath string, Matc
 
 	textSection := elfFile.Section(funSection)
 	if textSection == nil {
-		fmt.Println("no text section", nil)
+		//fmt.Println("no text section", nil)
 		return nil, nil
 	}
 	textSectionData, err := textSection.Data()
 	if err != nil {
-		fmt.Println("failed to read text section", err)
+		//fmt.Println("failed to read text section", err)
 		return nil, err
 	}
 	textSectionLen := uint64(len(textSectionData) - 1)
@@ -218,10 +217,12 @@ func (c *Container) getJavaAOTUprobes(binType, path string, dbgpath string, Matc
 			break
 		}
 		if err != nil {
-			log.Fatalf("Error reading entry: %v", err)
+			//log.Fatalf("Error reading entry: %v", err)
+			klog.Fatalf("Error reading entry: %v", err)
 		}
 		if entry == nil {
-			log.Println("Warning: a nil entry was returned with no error")
+			//log.Println("Warning: a nil entry was returned with no error")
+			klog.Warn("Warning: a nil entry was returned with no error")
 			break
 		}
 		if entry.Tag == dwarf.TagSubprogram {
@@ -268,7 +269,7 @@ func (c *Container) getJavaAOTUprobes(binType, path string, dbgpath string, Matc
 				case int64:
 					vv.RetAddress = uint64(retAddr.(int64))
 				default:
-					fmt.Println("Unknown type")
+					//fmt.Println("Unknown type")
 				}
 			}
 			listEntry[specAddr] = vv
@@ -276,7 +277,7 @@ func (c *Container) getJavaAOTUprobes(binType, path string, dbgpath string, Matc
 	}
 
 	for _, v := range listEntry {
-		fmt.Printf("Need Attach Function %s address: %x, %x\n", v.Name, v.EntAddress, v.RetAddress)
+		//fmt.Printf("Need Attach Function %s address: %x, %x\n", v.Name, v.EntAddress, v.RetAddress)
 
 		sStart := v.EntAddress - textSection.Addr
 		sSize := v.RetAddress

+ 5 - 5
containers/container.go

@@ -652,7 +652,7 @@ func (c *Container) onListenClose(pid uint32, addr netaddr.IPPort) {
 }
 
 func (c *Container) onAcceptOpen(pid uint32, fd uint64, src, dst netaddr.IPPort, timestamp uint64, failed bool, duration time.Duration) {
-	klog.Infof("accept pid=%d id=%s dstaddr=%s srcaddr=%s", pid, c.id, dst.IP(), src.IP())
+	//klog.Infof("accept pid=%d id=%s dstaddr=%s srcaddr=%s", pid, c.id, dst.IP(), src.IP())
 	// if common.PortFilter.ShouldBeSkipped(dst.Port()) {
 	// 	return
 	// }
@@ -866,7 +866,7 @@ func (c *Container) updateAcceptTrafficStats(ac *ActiveAccept, sent, received ui
 	if ac == nil {
 		return
 	}
-	klog.Infoln("TCP onConnectionClose5", ac.BytesSent, ac.BytesReceived, ac)
+	//klog.Infoln("TCP onConnectionClose5", ac.BytesSent, ac.BytesReceived, ac)
 	key := AddrPair{src: ac.Src, dst: ac.Dest}
 	stats := c.acceptsSuccessful[key]
 	if stats == nil {
@@ -1200,7 +1200,7 @@ func (c *Container) runLogParser(logPath string) {
 			parser.Stop()
 			return
 		}
-		klog.Infoln("started varlog logparser", "cg", c.cgroup.Id, "log", logPath)
+		//klog.Infoln("started varlog logparser", "cg", c.cgroup.Id, "log", logPath)
 		c.logParsers[logPath] = &LogParser{parser: parser, stop: reader.Stop}
 		return
 	}
@@ -1530,12 +1530,12 @@ func (c *Container) attachJVMUprobes(tracer *ebpftracer.Tracer, pid uint32) erro
 			}
 		}
 
-		libNioProbes, err := tracer.AttachJavaNioReadUprobes(pid, codeType, rootfs)
+		/*libNioProbes, err := tracer.AttachJavaNioReadUprobes(pid, codeType, rootfs)
 		if err != nil {
 			klog.Error(err)
 			return err
 		}
-		p.uprobes = append(p.uprobes, libNioProbes...)
+		p.uprobes = append(p.uprobes, libNioProbes...)*/
 
 		libNetProbes, err := tracer.AttachJavaNetWriteUprobes(pid, rootfs)
 		if err != nil {

+ 12 - 12
containers/container_apm.go

@@ -59,7 +59,7 @@ func (c *Container) InitTrace(traceId uint64, r *l7.RequestData) error {
 	method, path, hostIp, port := l7.ParseHttpHost(r.Payload)
 	ip, err := netaddr.ParseIP(hostIp)
 	if err != nil {
-		fmt.Println("host ip error")
+		//fmt.Println("host ip error")
 		hostIp = "127.0.0.1"
 	}
 	addr := netaddr.IPPortFrom(ip, port)
@@ -79,7 +79,7 @@ func (c *Container) InitTrace(traceId uint64, r *l7.RequestData) error {
 func (c *Container) SendEvent(t *tracing.Trace, traceID uint64) {
 	if t.AllEventReady(traceID) {
 		t.SendEvent()
-		klog.Infof("SendEvent %d", traceID)
+		//klog.Infof("SendEvent %d", traceID)
 		//fmt.Println(t.GetSpan())
 		//fmt.Println("===============")
 		delete(c.traceMap, traceID)
@@ -115,7 +115,7 @@ func (c *Container) onL7RequestApm(pid uint32, fd uint64, timestamp uint64, r *l
 		if r.TraceStart == TRACE_STATUS {
 			// klog.Infof("====ProtocolTrace start==== %d %d", pid, r.TraceId)
 			trace, err := c.getOrInitTrace(r.TraceId)
-			klog.Infof("payload:[%s]", r.Payload)
+			//klog.Infof("payload:[%s]", r.Payload)
 			if err == nil {
 				method, requestURI, sn, sport := l7.ParseHttpHost(r.Payload)
 				ip, _ := netaddr.ParseIP(sn)
@@ -127,7 +127,7 @@ func (c *Container) onL7RequestApm(pid uint32, fd uint64, timestamp uint64, r *l
 			return nil
 		}
 		if r.TraceEnd == TRACE_STATUS {
-			klog.Infof("====ProtocolTrace end==== %d %d", pid, r.TraceId)
+			//klog.Infof("====ProtocolTrace end==== %d %d", pid, r.TraceId)
 			trace, err := c.getOrInitTrace(r.TraceId)
 			if err == nil {
 				trace.TraceEndEvent(r)
@@ -367,14 +367,14 @@ func (c *Container) StackProcess(event ebpftracer.StackEvent, tracer *ebpftracer
 	// get the associated uprobe
 	uprobe, err := c.GetUprobe(event, tracer)
 	if err != nil {
-		fmt.Println("GetUprobeGetUprobe errer: %v", err)
-		// log.Errorf("failed to get uprobe for event %+v: %+v", event, err)
+		//fmt.Println("GetUprobeGetUprobe errer: %v", err)
+		klog.Errorf("failed to get uprobe for event %+v: %+v", event, err)
 		return
 	}
 
 	if event.TraceId <= 0 {
-		fmt.Println("StackProcess TraceId id 0")
-		// log.Errorf("failed to get uprobe for event %+v: %+v", event, err)
+		//fmt.Println("StackProcess TraceId id 0")
+		klog.Errorf("failed to get uprobe(traceId is <= 0) for event %+v", event)
 		return
 	}
 
@@ -409,8 +409,8 @@ func (c *Container) StackProcess2(event ebpftracer.StackEvent, tracer *ebpftrace
 		if event.Type != uint64(CodeTypeJava) {
 			uprobe, err := c.GetUprobe(event, tracer)
 			if err != nil {
-				fmt.Println("GetUprobeGetUprobe errer: %v", err)
-				// log.Errorf("failed to get uprobe for event %+v: %+v", event, err)
+				//fmt.Println("GetUprobeGetUprobe errer: %v", err)
+				klog.Errorf("failed to get uprobe for event %+v: %+v", event, err)
 				return
 			}
 			Funcname = uprobe.Funcname
@@ -421,8 +421,8 @@ func (c *Container) StackProcess2(event ebpftracer.StackEvent, tracer *ebpftrace
 		}
 
 		if event.TraceId <= 0 {
-			fmt.Println("StackProcess TraceId id 0")
-			// log.Errorf("failed to get uprobe for event %+v: %+v", event, err)
+			//fmt.Println("StackProcess TraceId id 0")
+			klog.Errorf("failed to get uprobe(traceId is <= 0) for event %+v", event)
 			return
 		}
 

+ 1 - 1
containers/dotnet.go

@@ -182,7 +182,7 @@ func (m *DotNetMonitor) connect(ctx context.Context) error {
 	if len(files) != 1 {
 		return fmt.Errorf("no socket found")
 	}
-	klog.Infoln(".NET diagnostic socket:", files[0])
+	//klog.Infoln(".NET diagnostic socket:", files[0])
 	c := dotnetdiag.NewClient(files[0], dotnetdiag.WithDialer(func(addr string) (net.Conn, error) {
 		return net.DialTimeout("unix", addr, dotNetDiagnosticTimeout)
 	}))

+ 4 - 4
containers/registry.go

@@ -264,7 +264,7 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 				if !c.Dead(now) {
 					continue
 				}
-				klog.Infoln("deleting dead container:", id)
+				//klog.Infoln("deleting dead container:", id)
 				for cg, cc := range r.containersByCgroupId {
 					if cc == c {
 						delete(r.containersByCgroupId, cg)
@@ -445,7 +445,7 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 					//fmt.Println("EventTypeL7Request", e.Pid, c.Isl7AttachSuccess())
 					//a, _ := json.Marshal(e.L7Request)
 					//fmt.Println("EventTypeL7Request", e.Pid, string(a))
-					klog.Debugln("Payload:", string(e.L7Request.Payload))
+					//klog.Debugln("Payload:", string(e.L7Request.Payload))
 					ip2fqdn := c.onL7RequestApm(e.Pid, e.Fd, e.Timestamp, e.L7Request)
 					r.ip2fqdnLock.Lock()
 					for ip, fqdn := range ip2fqdn {
@@ -459,12 +459,12 @@ func (r *Registry) handleEvents(ch <-chan ebpftracer.Event) {
 				}
 
 				if c := r.containersByPid[uint32(e.StackEvent.Pid)]; c != nil {
-					if e.StackEvent.Type == uint64(CodeTypeJava) {
+					/*if e.StackEvent.Type == uint64(CodeTypeJava) {
 						klog.Debugf("e.EventTypeFunEnt: TraceId:%d, Pid:%d, Location:%d, Goid:%d, TimeNs:%d, Ip:%X, CallerIp:%d, Bp:%d, CallerBp:%d\n", e.StackEvent.TraceId, e.StackEvent.Pid, e.StackEvent.Location, e.StackEvent.Goid, e.StackEvent.TimeNsStart, e.StackEvent.Ip, e.StackEvent.CallerIp, e.StackEvent.Bp, e.StackEvent.CallerBp)
 						klog.Debugf("e.EventTypeFunEnt: TraceId: MethedName: %d -- %s -- %s", e.StackEvent.Type, e.StackEvent.MethedName, e.StackEvent.ClassName)
 					} else {
 						klog.Debugf("e.EventTypeFunEnt: TraceId:%d, Pid:%d, Location:%d, Goid:%d, TimeNs:%d, Ip:%X, CallerIp:%x, Bp:%x, CallerBp:%x\n", e.StackEvent.TraceId, e.StackEvent.Pid, e.StackEvent.Location, e.StackEvent.Goid, e.StackEvent.TimeNsStart, e.StackEvent.Ip, e.StackEvent.CallerIp, e.StackEvent.Bp, e.StackEvent.CallerBp)
-					}
+					}*/
 					c.StackProcess2(*e.StackEvent, r.tracer)
 				} else {
 					// fmt.Printf("e.EventTypeFunEnt ErrorError: TraceId:%d, Pid:%d, Location:%d, Goid:%d, TimeNs:%d, Ip:%X, CallerIp:%x, Bp:%x, CallerBp:%x", e.StackEvent.TraceId, e.StackEvent.Pid, e.StackEvent.Location, e.StackEvent.Goid, e.StackEvent.TimeNsStart, e.StackEvent.Ip, e.StackEvent.CallerIp, e.StackEvent.Bp, e.StackEvent.CallerBp)

+ 6 - 6
ebpftracer/tls.go

@@ -250,12 +250,12 @@ func (t *Tracer) AttachGoTlsUprobes(pid uint32, appInfo *AppInfo, codeType uint1
 				info.StartAddr = allocDetails.StartAddr
 				info.EndAddr = allocDetails.EndAddr
 			}
-			klog.Infoln("Major:", major)
-			klog.Infoln("Minor:", minor)
-			klog.Infoln("Revision:", revision)
-			klog.Infoln("goVersion", goVersion)
-			klog.Infoln("info.StartAddr", info.StartAddr)
-			klog.Infoln("info.EndAddr", info.EndAddr)
+			//klog.Infoln("Major:", major)
+			//klog.Infoln("Minor:", minor)
+			//klog.Infoln("Revision:", revision)
+			//klog.Infoln("goVersion", goVersion)
+			//klog.Infoln("info.StartAddr", info.StartAddr)
+			//klog.Infoln("info.EndAddr", info.EndAddr)
 			_, err = tracer.UpdateProcInfoToMap(t.collection, pid, info)
 			if err != nil {
 				klog.Error("failed to update program info", err)

+ 4 - 4
ebpftracer/tracer.go

@@ -754,10 +754,10 @@ func runEventsReader(name string, r *perf.Reader, ch chan<- Event, typ perfMapTy
 				ComponentSAddr: ipPort(v.ComponentSAddr, v.ComponentSport),
 				ComponentDAddr: ipPort(v.ComponentDAddr, v.ComponentDport),
 			}
-			if req.Protocol == l7.ProtocolHTTP {
+			/*if req.Protocol == l7.ProtocolHTTP {
 				klog.Infof("runEventsReader ComponentSAddr.String %s", req.ComponentSAddr.String())
 				klog.Infof("runEventsReader ComponentDAddr.String %s", req.ComponentDAddr.String())
-			}
+			}*/
 			if v.TraceEnd == 1 {
 				req.ParentSpanContext.TraceIdFrom = hex.EncodeToString(v.TraceIdFrom[:])
 				req.ParentSpanContext.CalledId = hex.EncodeToString(v.CalledId[:])
@@ -766,8 +766,8 @@ func runEventsReader(name string, r *perf.Reader, ch chan<- Event, typ perfMapTy
 				req.ParentSpanContext.SpanIdFrom = hex.EncodeToString(v.SpanIdFrom[:])
 				req.SAddr = ipPort(v.SAddr, v.Sport)
 				req.DAddr = ipPort(v.DAddr, v.Dport)
-				klog.Infof("runEventsReader SAddr.String %s", req.SAddr.String())
-				klog.Infof("runEventsReader DAddr.String %s", req.DAddr.String())
+				//klog.Infof("runEventsReader SAddr.String %s", req.SAddr.String())
+				//klog.Infof("runEventsReader DAddr.String %s", req.DAddr.String())
 			}
 			switch {
 			case v.PayloadSize == 0:

+ 1 - 1
flags/flags.go

@@ -20,7 +20,7 @@ var (
 	DataServer          = kingpin.Flag("data-server", "The URL of the endpoint to send traces to").Envar("DATA_SERVER").Default("http://10.0.16.250:18080").String()
 	DumpApps            = kingpin.Flag("dump", "Dump app snap").Default("false").Bool()
 	Version             = kingpin.Flag("version", "show app version").Short('v').Bool()
-	LogLevel            = kingpin.Flag("log-level", "Log level").Envar("LOG_LEVEL").Default("info").String()
+	LogLevel            = kingpin.Flag("log-level", "Log level").Envar("LOG_LEVEL").Default("error").String()
 	EbpfFilePath        = kingpin.Flag("ebpf-path", "Set ebpf file path").Envar("EBPF_FILE").Default("").String()
 	CommonIni           = kingpin.Flag("common.ini", "Set ebpf file path").Envar("COMMON_INI").Default("/opt/cloudwise/omniagent/conf/common.ini").String()
 	ServerPrefix        = kingpin.Flag("server-prefix", "server-prefix").Envar("SERVER_PREFIX").Default("").String()

+ 1 - 1
main.go

@@ -322,7 +322,7 @@ func main() {
 		if err != nil {
 			return
 		}
-		log.Infoln("netdata is:", string(jsonData))
+		//log.Infoln("netdata is:", string(jsonData))
 		// 创建请求
 		urlRoute := "/api/v2/ebpf/receive"
 

+ 5 - 7
pkg/go.opentelemetry.io/otel/exporters/otlp/otlptrace/apm_exporter.go

@@ -2,12 +2,10 @@ package otlptrace
 
 import (
 	"crypto/md5"
-	"encoding/json"
 	"fmt"
 	. "github.com/coroot/coroot-node-agent/ebpftracer"
 	"github.com/coroot/coroot-node-agent/ebpftracer/l7"
 	"github.com/coroot/coroot-node-agent/utils"
-	klog "github.com/sirupsen/logrus"
 	"math"
 	"net/url"
 	"sort"
@@ -225,8 +223,8 @@ func tracetransformData(sdl []tracesdk.ReadOnlySpan) map[int][]RootDataT {
 	//}
 
 	//Transform the categorized map into a slice
-	data, _ := json.Marshal(sendDataMap)
-	klog.Info(string(data))
+	/*data, _ := json.Marshal(sendDataMap)
+	klog.Info(string(data))*/
 	//fmt.Println(len(sendData))
 	//fmt.Println("sdl len:", len(sdl))
 	return sendDataMap
@@ -337,8 +335,8 @@ func buildLevelFromEvent(sdl *RootDataT) {
 	Nid := 2
 	level := 2
 
-	for k, v := range mapSlice {
-		klog.Debugln("SliceSliceindex", k, "value", v.Time, v.Type, v.Map.MethodName, v.Map.Nid)
+	for _, v := range mapSlice {
+		//klog.Debugln("SliceSliceindex", k, "value", v.Time, v.Type, v.Map.MethodName, v.Map.Nid)
 		if v.Type == 0 {
 			// 函数入口
 			funStack = append(funStack, v)
@@ -713,7 +711,7 @@ func buildAppMapFromEvent(traceRoot *RootDataT, sd apmTraceSpan) int {
 	//traceRoot.RespTime = mNode.PureTimex
 	//traceRoot.CollTime = mNode.StartTime
 	for _, attr := range sd.Attributes() {
-		klog.Debugln("Appmap:", attr.Key, ":", attr.Value.AsInterface())
+		//klog.Debugln("Appmap:", attr.Key, ":", attr.Value.AsInterface())
 		switch attr.Key {
 		case "http.uri":
 			traceRoot.Uri, traceRoot.Parameters, _ = parseURIToParams(attr.Value.AsString())

+ 4 - 4
pkg/go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp/client_apm.go

@@ -20,7 +20,7 @@ func (d *client) UploadApmTraces(ctx context.Context, rootData []otlptrace.RootD
 	//pbRequest := &coltracepb.ExportTraceServiceRequest{
 	//	ResourceSpans: protoSpans,
 	//}
-	klog.Infoln("enter the UploadApmTraces newApmRequest-----")
+	//klog.Infoln("enter the UploadApmTraces newApmRequest-----")
 	rawRequest, err := json.Marshal(rootData)
 	if err != nil {
 		return err
@@ -29,7 +29,7 @@ func (d *client) UploadApmTraces(ctx context.Context, rootData []otlptrace.RootD
 	ctx, cancel := d.contextWithStop(ctx)
 	defer cancel()
 	mapLen := len(rootData)
-	klog.Infoln("enter the UploadApmTraces newApmRequest")
+	//klog.Infoln("enter the UploadApmTraces newApmRequest")
 	request, err := d.newApmRequest(rawRequest, mapLen, CodeType(codeType))
 	if err != nil {
 		return err
@@ -113,7 +113,7 @@ func (d *client) newApmRequest(body []byte, mapLen int, codeType CodeType) (requ
 	r.Header.Set("Content-Type", "text/plain;charset=utf-8")
 
 	r.Header.Set("routingKey", codeType.Topic())
-	klog.Infoln(codeType.Topic())
+	//klog.Infoln(codeType.Topic())
 	r.Header.Set("DataCount", strconv.Itoa(mapLen))
 
 	req := request{Request: r}
@@ -146,7 +146,7 @@ func (d *client) newApmRequest(body []byte, mapLen int, codeType CodeType) (requ
 
 		req.bodyReader = bodyReader(b.Bytes())
 	case ZstdCompression:
-		klog.Infoln("enter the ZstdCompression newApmRequest")
+		//klog.Infoln("enter the ZstdCompression newApmRequest")
 		r.ContentLength = -1
 		r.Header.Set("Content-Encoding", "zstd")
 		encoder, err := zstd.NewWriter(nil)

+ 3 - 4
tracing/apm_tracing.go

@@ -12,7 +12,6 @@ import (
 	"github.com/coroot/coroot-node-agent/ebpftracer/l7"
 	"github.com/coroot/coroot-node-agent/utils"
 	. "github.com/coroot/coroot-node-agent/utils/modelse"
-	klog "github.com/sirupsen/logrus"
 	"go.opentelemetry.io/otel/attribute"
 	"go.opentelemetry.io/otel/codes"
 	semconv "go.opentelemetry.io/otel/semconv/v1.18.0"
@@ -123,7 +122,7 @@ func (t *Trace) endReadyEvent(needCount uint32) {
 }
 
 func (t *Trace) AllEventReady(traceID uint64) bool {
-	klog.Infof("[AllEventReady (current/need)|start|end|traceid](%d/%d)%v|%v|%d", *t.currenEventCount, t.needEventCount, t.startEventReady, t.endEventReady, traceID)
+	//klog.Infof("[AllEventReady (current/need)|start|end|traceid](%d/%d)%v|%v|%d", *t.currenEventCount, t.needEventCount, t.startEventReady, t.endEventReady, traceID)
 	return t.startEventReady && t.endEventReady && *t.currenEventCount >= t.needEventCount
 }
 
@@ -244,8 +243,8 @@ func (t *Trace) TraceEndEvent(r *l7.RequestData) {
 
 	attr = append(attr, attribute.String("server.src_addr", r.DAddr.String()))
 	attr = append(attr, attribute.String("server.dst_addr", r.SAddr.String()))
-	klog.Infof("TraceEndEvent SAddr.String %s", r.SAddr.String())
-	klog.Infof("TraceEndEvent DAddr.String %s", r.DAddr.String())
+	//klog.Infof("TraceEndEvent SAddr.String %s", r.SAddr.String())
+	//klog.Infof("TraceEndEvent DAddr.String %s", r.DAddr.String())
 
 	t.appendTimestamp(&attr, r.StartAt, r.EndAt, r.Duration.Nanoseconds())
 	t.span.SetAttributes(attr...)

+ 12 - 10
utils/worker/serverWorker.go

@@ -86,9 +86,10 @@ func (w *ServerHTTPWorker) PullAllAppInfo(request EbpfAppReq) (EbpfAppResp, erro
 }
 
 func (w *ServerHTTPWorker) RegisterHost(request RegisterHostReq) error {
-	log.Infof("[server register host] request:%v.", utils.ToString(request))
-	result, err := w.requestServer("/v2/app/registerHost", request)
-	log.Infof("[server register host] resp:%v.", string(result))
+	//log.Infof("[server register host] request:%v.", utils.ToString(request))
+	//result, err := w.requestServer("/v2/app/registerHost", request)
+	_, err := w.requestServer("/v2/app/registerHost", request)
+	//log.Infof("[server register host] resp:%v.", string(result))
 	if err != nil {
 		log.WithError(err).Errorf("[server register] Failed RegisterHost request:%v.", utils.ToString(request))
 		return err
@@ -97,9 +98,10 @@ func (w *ServerHTTPWorker) RegisterHost(request RegisterHostReq) error {
 }
 
 func (w *ServerHTTPWorker) RegisterApp(request RegisterAppReq) error {
-	log.Infof("[server register app] request:%v.", utils.ToString(request))
-	result, err := w.requestServer("/v2/app/create", request)
-	log.Infof("[server register app] resp data:%v.", string(result))
+	//log.Infof("[server register app] request:%v.", utils.ToString(request))
+	//result, err := w.requestServer("/v2/app/create", request)
+	_, err := w.requestServer("/v2/app/create", request)
+	//log.Infof("[server register app] resp data:%v.", string(result))
 	if err != nil {
 		log.WithError(err).Errorf("[server register] Failed RegisterApp request:%v.", utils.ToString(request))
 		return err
@@ -108,10 +110,10 @@ func (w *ServerHTTPWorker) RegisterApp(request RegisterAppReq) error {
 }
 
 func (w *ServerHTTPWorker) WhiteList(request WhiteListReq) (WhiteData, error) {
-	log.Infof("[server whitelist] request:%v.", request.String())
+	//log.Infof("[server whitelist] request:%v.", request.String())
 	response := WhiteData{}
 	result, err := w.requestServer("/api/v1/agent/whitelist", request)
-	log.Infof("[server whitelist] resp data:%v.", string(result))
+	//log.Infof("[server whitelist] resp data:%v.", string(result))
 	if err != nil {
 		return response, err
 	}
@@ -124,10 +126,10 @@ func (w *ServerHTTPWorker) WhiteList(request WhiteListReq) (WhiteData, error) {
 }
 
 func (w *ServerHTTPWorker) WhiteListV2(request WhiteListReq) (WhiteDataV2, error) {
-	log.Infof("[server whitelist] request:%v.", request.String())
+	//log.Infof("[server whitelist] request:%v.", request.String())
 	response := WhiteDataV2{}
 	result, err := w.requestServer("/api/v1/agent/whitelist", request)
-	log.Infof("[server whitelist] resp data:%v.", string(result))
+	//log.Infof("[server whitelist] resp data:%v.", string(result))
 	if err != nil {
 		return response, err
 	}