You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "DMwangnima (via GitHub)" <gi...@apache.org> on 2024/01/02 11:27:11 UTC

[I] Triple Open Tracing support [dubbo-go]

DMwangnima opened a new issue, #2554:
URL: https://github.com/apache/dubbo-go/issues/2554

   <!-- Please only use this template for submitting enhancement requests -->
   
   **What would you like to be added**:
   
   Triple Open-Tracing support:
   1. Consider a better way to inject Open-Tracing configurations to Triple protocol adaptation layer(/protocol/triple). For old Triple(/protocol/dubbo3), it retrieves configurations from config package directly. It is not a good design.
   
   2. Implement Open-Tracing Interceptor for Triple protocol. You can refer to this part(https://connectrpc.com/docs/go/observability). But there are some differences between Triple protocol and connect-go.
   
   3. Tests implementation.
   For Triple protocol adaptation part, Please design tests to verify that Open-Tracing configurations have been injected successfully and the necessary information in these configurations have been processed well. You can add tests in /protocol/triple/triple_test.go or some place more ideal.
   
   For Triple protocol part, It is a good chance to learn the details about this protocol from outside to inside. You should write some unit tests to verify that Open-Tracing Interceptor has been configured successfully and this functionality works well in the context of Triple protocol.
   
   For dubbo-go-samples(Integration test), please refer to /tracing directory and write new tests using new API.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] Triple OpenTelemetry support [dubbo-go]

Posted by "marsevilspirit (via GitHub)" <gi...@apache.org>.
marsevilspirit commented on issue #2554:
URL: https://github.com/apache/dubbo-go/issues/2554#issuecomment-2888972223

   @marsevilspirit 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] Triple OpenTelemetry support [dubbo-go]

Posted by "AlexStocks (via GitHub)" <gi...@apache.org>.
AlexStocks closed issue #2554: Triple OpenTelemetry support
URL: https://github.com/apache/dubbo-go/issues/2554


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [I] Triple OpenTelemetry support [dubbo-go]

Posted by "Alanxtl (via GitHub)" <gi...@apache.org>.
Alanxtl commented on issue #2554:
URL: https://github.com/apache/dubbo-go/issues/2554#issuecomment-3306168030

   # otel ability check
   
   - all test use new api and otel http exporter
   - 经验证 triple/dubbo/jsonrpc 协议的otel trace能力是没问题的
   
   ## test case
   
   ### server 端代码
   ```go
   	ins, err := dubbo.NewInstance(
   		dubbo.WithName("dubbo_otel_server"),
   		dubbo.WithTracing(
   			trace.WithEnabled(),
   			trace.WithOtlpHttpExporter(),
   			trace.WithW3cPropagator(),
   			trace.WithAlwaysMode(),
   			trace.WithEndpoint("127.0.0.1:4318"),
   			trace.WithInsecure(),
   		),
   		dubbo.WithProtocol(
   			protocol.WithTriple(),
   			protocol.WithPort(20000)),
   		dubbo.WithProtocol(
   			protocol.WithDubbo(),
   			protocol.WithPort(20001)),
   		dubbo.WithProtocol(
   			protocol.WithJSONRPC(),
   			protocol.WithPort(20002)),
   	)
   	if err != nil {
   		panic(err)
   	}
   
   	//Triple
   	srv, err := ins.NewServer()
   	if err != nil {
   		panic(err)
   	}
   	if err = greet.RegisterGreetServiceHandler(srv, &GreetMultiRPCServer{}); err != nil {
   		panic(err)
   	}
   
   	//Dubbo & JsonRPC
   	if err = srv.Register(&GreetProvider{}, &common.ServiceInfo{}, server.WithInterface("GreetProvider")); err != nil {
   		panic(err)
   	}
   	if err = srv.Serve(); err != nil {
   		logger.Error(err)
   	}
   ```
   
   
   
   ### client 端代码
   ```go
   func main() {
   	// Initialize instance
   	ins, err := initDubboInstance()
   	if err != nil {
   		panic(err)
   	}
   
   	// Call services using different protocols
   	if err = callTripleService(ins); err != nil {
   		logger.Error(err)
   	}
   	time.Sleep(5 * time.Second) // wait for span exported
   
   	if err = callDubboService(ins); err != nil {
   		logger.Error(err)
   	}
   	time.Sleep(5 * time.Second) // wait for span exported
   
   	if err = callJsonRpcService(ins); err != nil {
   		logger.Error(err)
   	}
   	time.Sleep(5 * time.Second) // wait for span exported
   }
   
   // Initialize Dubbo instance
   func initDubboInstance() (*dubbo.Instance, error) {
   	return dubbo.NewInstance(
   		dubbo.WithName("dubbo_otel_tracing_client"),
   		dubbo.WithTracing(
   			trace.WithEnabled(),
   			trace.WithOtlpHttpExporter(),
   			trace.WithW3cPropagator(),
   			trace.WithAlwaysMode(),
   			trace.WithEndpoint("127.0.0.1:4318"),
   			trace.WithInsecure(),
   		),
   	)
   }
   
   // Call Triple protocol service
   func callTripleService(ins *dubbo.Instance) error {
   	cli, err := ins.NewClient(
   		client.WithClientProtocolTriple(),
   		client.WithClientURL("127.0.0.1:20000"),
   	)
   	if err != nil {
   		return fmt.Errorf("failed to create triple client: %w", err)
   	}
   
   	svc, err := greet2.NewGreetService(cli)
   	if err != nil {
   		return fmt.Errorf("failed to create greet service: %w", err)
   	}
   
   	resp, err := svc.Greet(context.Background(), &greet2.GreetRequest{Name: "hello world"})
   	if err != nil {
   		return fmt.Errorf("triple service call failed: %w", err)
   	}
   
   	logger.Infof("Greet triple response: %s", resp.Greeting)
   	return nil
   }
   
   // Call Dubbo protocol service
   func callDubboService(ins *dubbo.Instance) error {
   	cli, err := ins.NewClient(
   		client.WithClientProtocolDubbo(),
   		client.WithClientSerialization(constant.Hessian2Serialization),
   		client.WithClientURL("127.0.0.1:20001"),
   	)
   	if err != nil {
   		return fmt.Errorf("failed to create dubbo client: %w", err)
   	}
   
   	conn, err := cli.Dial("GreetProvider")
   	if err != nil {
   		return fmt.Errorf("failed to dial dubbo service: %w", err)
   	}
   
   	var resp string
   	if err := conn.CallUnary(context.Background(), []interface{}{"hello", "new", "dubbo"}, &resp, "SayHello"); err != nil {
   		return fmt.Errorf("dubbo service call failed: %w", err)
   	}
   
   	logger.Infof("Get dubbo Response: %s", resp)
   	return nil
   }
   
   // Call JsonRPC protocol service
   func callJsonRpcService(ins *dubbo.Instance) error {
   	cli, err := ins.NewClient(
   		client.WithClientProtocolJsonRPC(),
   		client.WithClientSerialization(constant.JSONSerialization),
   		client.WithClientURL("127.0.0.1:20002"),
   	)
   	if err != nil {
   		return fmt.Errorf("failed to create jsonrpc client: %w", err)
   	}
   
   	conn, err := cli.Dial("GreetProvider")
   	if err != nil {
   		return fmt.Errorf("failed to dial jsonrpc service: %w", err)
   	}
   
   	var resp string
   	if err := conn.CallUnary(context.Background(), []interface{}{"hello", "new", "jsonrpc"}, &resp, "SayHello"); err != nil {
   		return fmt.Errorf("jsonrpc service call failed: %w", err)
   	}
   
   	logger.Infof("Get jsonrpc Response: %s", resp)
   	return nil
   }
   
   ```
   
   
   <details>
   <summary>triple otel trace 数据</summary>
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_server"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"N\xc8[\xa5s\xa6\xf0\xb2\x8a#\x97\x91\xdc\xfcj{"  span_id:"̈\r\x8a\xf1K!\xe1"  parent_span_id:"\xbf\xa4\xa2}\xcf|\xa3\x7f"  name:"Greet"  kind:SPAN_KIND_SERVER  start_time_unix_nano:1758183734704787429  end_time_unix_nano:1758183734704797481  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"greet.GreetService"}}  attributes:{key:"rpc.method"  value:{string_value:"Greet"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_client"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"N\xc8[\xa5s\xa6\xf0\xb2\x8a#\x97\x91\xdc\xfcj{"  span_id:"\xbf\xa4\xa2}\xcf|\xa3\x7f"  name:"Greet"  kind:SPAN_KIND_CLIENT  start_time_unix_nano:1758183734703976364  end_time_unix_nano:1758183734706607662  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"greet.GreetService"}}  attributes:{key:"rpc.method"  value:{string_value:"Greet"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   </details>
   
   <details>
   <summary>dubbo otel trace 数据</summary>
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_server"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"O*\xf7\xacI$\xb3\x85.\xa0%\xf8\x9b#bg"  span_id:" \xfa\x85-\xc1C\x05M"  name:"SayHello"  kind:SPAN_KIND_SERVER  start_time_unix_nano:1758183739710466413  end_time_unix_nano:1758183739710511646  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"GreetProvider"}}  attributes:{key:"rpc.method"  value:{string_value:"SayHello"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_client"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"r\x85\xd8O>\xa7\xc1\xe7\x0e\x10\xe7^\xa2\xe1\xb2\xfd"  span_id:"\xfc\xc75?pr\xfdR"  name:"SayHello"  kind:SPAN_KIND_CLIENT  start_time_unix_nano:1758183739710214377  end_time_unix_nano:1758183739710646696  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"GreetProvider"}}  attributes:{key:"rpc.method"  value:{string_value:"SayHello"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   </details>
   
   <details>
   <summary>jsonrpc otel trace 数据</summary>
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_server"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"\x9eA&\x9dA^`\xd6\xcbM\x15\x11\x16x=@"  span_id:"=J\xa7N\x02\x13\xbfX"  name:"SayHello"  kind:SPAN_KIND_SERVER  start_time_unix_nano:1758183744711704645  end_time_unix_nano:1758183744711724089  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"GreetProvider"}}  attributes:{key:"rpc.method"  value:{string_value:"SayHello"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   resource_spans:{resource:{attributes:{key:"service.name"  value:{string_value:"dubbo_otel_client"}}  attributes:{key:"service.namespace"  value:{string_value:"dubbo-go"}}  attributes:{key:"service.version"  value:{string_value:""}}}  scope_spans:{scope:{name:"go.opentelemetry.io/otel"  version:"1.21.0"}  spans:{trace_id:"،\x9flk\x80\x7f*\x9a-BVg\x88Dr"  span_id:"b\xfa\x8b\x1b\xba\xb7\xcbv"  name:"SayHello"  kind:SPAN_KIND_CLIENT  start_time_unix_nano:1758183744711144947  end_time_unix_nano:1758183744711939480  attributes:{key:"rpc.system"  value:{string_value:"apache_dubbo"}}  attributes:{key:"rpc.service"  value:{string_value:"GreetProvider"}}  attributes:{key:"rpc.method"  value:{string_value:"SayHello"}}  status:{code:STATUS_CODE_OK}}}}
   
   
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org