You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by "yanglimingcn (via GitHub)" <gi...@apache.org> on 2024/01/24 02:56:32 UTC

[PR] span for new bthread (brpc)

yanglimingcn opened a new pull request, #2519:
URL: https://github.com/apache/brpc/pull/2519

   ### What problem does this PR solve?
   
   Issue Number:
   
   Problem Summary:
   
   ### What is changed and the side effects?
   
   Changed:
   
   Side effects:
   - Performance effects(性能影响):
   
   - Breaking backward compatibility(向后兼容性): 
   
   ---
   ### Check List:
   - Please make sure your changes are compilable(请确保你的更改可以通过编译).
   - When providing us with a new feature, it is best to add related tests(如果你向我们增加一个新的功能, 请添加相关测试).
   - Please follow [Contributor Covenant Code of Conduct](../../master/CODE_OF_CONDUCT.md).(请遵循贡献者准则).
   


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1482210916


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   不是很理解,能举个例子吗?
   这里加了一个bthread span,在展示的时候其实看不到它,看上去像是server span的一部分。



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm merged PR #2519:
URL: https://github.com/apache/brpc/pull/2519


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on PR #2519:
URL: https://github.com/apache/brpc/pull/2519#issuecomment-1926075788

   @wwbmmm 这个PR有时间可以review了。


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on PR #2519:
URL: https://github.com/apache/brpc/pull/2519#issuecomment-1935250334

   LGTM


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1481020372


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   这个行为是不是加个开关来控制?否则可能会影响现有的用户



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1482419094


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   我这边使用的话,会通过rpcz_service服务把span信息查询出来,上报到我们的trace服务端,这里加了一个type,但是通过rpcz_service查询其实是感知不到bthread这个类型的,它看上去是server span的内容。
   其实我本来不想多加一个类型,但是没有这个类型处理上会不合理。
   不太清楚其他人的使用方式,如果依赖了span.proto确实协议变了。



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1483804359


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   ok



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on PR #2519:
URL: https://github.com/apache/brpc/pull/2519#issuecomment-1913831481

   这个是什么地方单测失败了,看不出来呢?显示不出来呢


-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "wwbmmm (via GitHub)" <gi...@apache.org>.
wwbmmm commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1482380653


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   如果只是使用内置服务查看应该没什么影响
   不过有些用户会自己处理Span数据,做一些分析、上报的工作,如果多了一种SpanType,可能需要特殊处理一下
   



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org


Re: [PR] span for new bthread (brpc)

Posted by "yanglimingcn (via GitHub)" <gi...@apache.org>.
yanglimingcn commented on code in PR #2519:
URL: https://github.com/apache/brpc/pull/2519#discussion_r1482420118


##########
src/brpc/global.cpp:
##########
@@ -329,6 +334,9 @@ static void GlobalInitializeOrDieImpl() {
     // Make GOOGLE_LOG print to comlog device
     SetLogHandler(&BaiduStreamingLogHandler);
 
+    // Set bthread create span function
+    bthread_set_create_span_func(CreateBthreadSpan);

Review Comment:
   感觉别人也得从rpcz_service查询trace内容比较合理,直接读trace这个leveldb也不太合理。



-- 
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: dev-unsubscribe@brpc.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@brpc.apache.org
For additional commands, e-mail: dev-help@brpc.apache.org