You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by GitBox <gi...@apache.org> on 2022/10/26 03:20:12 UTC

[GitHub] [incubator-brpc] ldak4747 opened a new pull request, #1964: support mvariable dump by prometheus rpc service

ldak4747 opened a new pull request, #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964

   ### 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](../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


[GitHub] [incubator-brpc] cdjingit commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
cdjingit commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1005264079


##########
src/bvar/mvariable.cpp:
##########
@@ -246,6 +248,11 @@ size_t MVariable::dump_exposed(Dumper* dumper, const DumpOptions* options) {
         if (entry) {
             n += entry->var->dump(dumper, &opt);
         }
+	if (n > static_cast<size_t>(FLAGS_bvar_max_dump_multi_dimension_metric_number)) {
+            LOG(WARNING) << "truncated because of \

Review Comment:
   日志里可以打出FLAGS_bvar_max_dump_multi_dimension_metric_number的值



-- 
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


[GitHub] [incubator-brpc] wwbmmm commented on pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#issuecomment-1291786786

   LGTM
   @serverglen 有空也看看


-- 
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


[GitHub] [incubator-brpc] serverglen merged pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen merged PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964


-- 
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


[GitHub] [incubator-brpc] wwbmmm commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
wwbmmm commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1005227617


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -200,6 +200,13 @@ int DumpPrometheusMetricsToIOBuf(butil::IOBuf* output) {
         return -1;
     }
     os.move_to(*output);
+
+    PrometheusMetricsDumper dumper_md(&os, g_server_info_prefix);

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


[GitHub] [incubator-brpc] serverglen commented on pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#issuecomment-1293456479

   Thanks for your contributions!


-- 
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


[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006422609


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

Review Comment:
   改成 brpc_metrics_mvariable_dump 是不是 好点?



-- 
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


[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006453757


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

Review Comment:
   这样也可以,也不用新增其他flags了,@ldak4747 要不在这里也判断下 FLAGS_bvar_max_dump_multi_dimension_metric_number 



-- 
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


[GitHub] [incubator-brpc] cdjingit commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
cdjingit commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006382654


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

Review Comment:
   这个是不是用FLAGS_bvar_max_dump_multi_dimension_metric_number 为0表示就可以了



-- 
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


[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1005599888


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -200,6 +200,13 @@ int DumpPrometheusMetricsToIOBuf(butil::IOBuf* output) {
         return -1;
     }
     os.move_to(*output);
+
+    PrometheusMetricsDumper dumper_md(&os, g_server_info_prefix);

Review Comment:
   是不是加个flags开关比较好?默认不输出多维度bvar。毕竟有些mbvar的维度可能比较多。



-- 
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


[GitHub] [incubator-brpc] cdjingit commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
cdjingit commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006438537


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

Review Comment:
   FLAGS_bvar_max_dump_multi_dimension_metric_number <= 0 就不调用bvar::MVariable::dump_exposed()了



-- 
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


[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006454157


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

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


[GitHub] [incubator-brpc] cdjingit commented on pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
cdjingit commented on PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#issuecomment-1291852611

   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


[GitHub] [incubator-brpc] serverglen commented on a diff in pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on code in PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#discussion_r1006420523


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -32,6 +32,8 @@ DECLARE_int32(bvar_latency_p2);
 DECLARE_int32(bvar_latency_p3);
 }
 
+DEFINE_bool(mvariable_dump_switch, false, "mvariable dump switch");

Review Comment:
   还是新增一个flags比较好吧,如果改成FLAGS_bvar_max_dump_multi_dimension_metric_number = 0,每次都会输出WARNING日志。



-- 
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


[GitHub] [incubator-brpc] serverglen commented on pull request #1964: support mvariable dump by prometheus rpc service

Posted by GitBox <gi...@apache.org>.
serverglen commented on PR #1964:
URL: https://github.com/apache/incubator-brpc/pull/1964#issuecomment-1293455603

   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