Parcourir la source

更新追踪埋点

lijian il y a 6 ans
Parent
commit
78ed4502c4

+ 0 - 4
pkg/rpcs/common.go

@@ -5,7 +5,3 @@ type ArgsDeviceId struct {
 }
 
 type ReplyEmptyResult struct{}
-
-type ArgsWithSpan struct {
-	SpanCarrier map[string]string
-}

+ 0 - 2
pkg/rpcs/fileaccess.go

@@ -2,7 +2,6 @@ package rpcs
 
 // ArgsMoveFile move file rpc args
 type ArgsMoveFile struct {
-	ArgsWithSpan
 	Source string
 	Target string
 }
@@ -14,6 +13,5 @@ type ReplyMoveFile struct {
 
 // ArgsDeleteFile 删除文件参数
 type ArgsDeleteFile struct {
-	ArgsWithSpan
 	FileName string
 }

+ 0 - 5
pkg/rpcs/registry.go

@@ -2,7 +2,6 @@ package rpcs
 
 // ArgsDeviceRegister device register args
 type ArgsDeviceRegister struct {
-	ArgsWithSpan
 	ProductKey    string
 	DeviceCode    string
 	DeviceVersion string
@@ -11,13 +10,11 @@ type ArgsDeviceRegister struct {
 
 // ArgsDeviceAuth device auth
 type ArgsDeviceAuth struct {
-	ArgsWithSpan
 	DeviceID int64
 }
 
 // ArgsDeviceUpdate device update args
 type ArgsDeviceUpdate struct {
-	ArgsWithSpan
 	DeviceIdentifier  string
 	DeviceName        string
 	DeviceDescription string
@@ -25,7 +22,6 @@ type ArgsDeviceUpdate struct {
 
 // ArgsProductList get products list args
 type ArgsProductList struct {
-	ArgsWithSpan
 	ArgsPage
 	VendorID    uint
 	ProductName string
@@ -33,7 +29,6 @@ type ArgsProductList struct {
 
 // ArgsPage page params
 type ArgsPage struct {
-	ArgsWithSpan
 	Pi int
 	Ps int
 }

+ 1 - 12
services/httpaccess/actions.go

@@ -61,14 +61,8 @@ func RegisterDevice(args DeviceRegisterArgs, r render.Render) {
 		DeviceVersion: args.Version,
 		ModuleName:    args.ModuleName,
 	}
-	rpcargs.SpanCarrier = make(map[string]string)
 	device := &models.Device{}
 	ext.SpanKindRPCClient.Set(span)
-	// span.Tracer().Inject(
-	// 	span.Context(),
-	// 	opentracing.TextMap,
-	// 	opentracing.TextMapCarrier(rpcargs.SpanCarrier),
-	// )
 	err := server.RPCCallByName(ctx, "registry", "Registry.RegisterDevice", rpcargs, device)
 	if err != nil {
 		r.JSON(http.StatusOK, renderError(ErrSystemFault, err))
@@ -95,17 +89,12 @@ func AuthDevice(args DeviceAuthArgs, r render.Render) {
 	arg := &rpcs.ArgsDeviceAuth{
 		DeviceID: args.DeviceId,
 	}
-	arg.SpanCarrier = make(map[string]string)
 
 	span, ctx := opentracing.StartSpanFromContext(context.Background(), "AuthDevice")
 	defer span.Finish()
 
 	ext.SpanKindRPCClient.Set(span)
-	// span.Tracer().Inject(
-	// 	span.Context(),
-	// 	opentracing.TextMap,
-	// 	opentracing.TextMapCarrier(arg.SpanCarrier),
-	// )
+
 	err := server.RPCCallByName(ctx, "registry", "Registry.FindDeviceById", arg, device)
 	if err != nil {
 		r.JSON(http.StatusOK, renderError(ErrDeviceNotFound, err))

+ 0 - 1
services/knowoapi/controllers/application.go

@@ -37,7 +37,6 @@ func (a *AppController) Post() {
 			Source: app.AppIcon,
 			Target: "application",
 		}
-		args.SpanCarrier = make(map[string]string)
 		reply := &rpcs.ReplyMoveFile{}
 		span, ctx := opentracing.StartSpanFromContext(context.Background(), a.Ctx.Path())
 		defer span.Finish()

+ 0 - 1
services/knowoapi/controllers/produdct.go

@@ -36,7 +36,6 @@ func (a *ProductController) Post() {
 			Source: product.ProductImage,
 			Target: "product",
 		}
-		args.SpanCarrier = make(map[string]string)
 		reply := &rpcs.ReplyMoveFile{}
 
 		span, ctx := opentracing.StartSpanFromContext(context.Background(), a.Ctx.Path())