You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pegasus.apache.org by GitBox <gi...@apache.org> on 2021/10/19 03:14:21 UTC
[GitHub] [incubator-pegasus] acelyc111 commented on a change in pull request #828: fix: coredump when table name contains '_' and prometheus is enabled
acelyc111 commented on a change in pull request #828:
URL: https://github.com/apache/incubator-pegasus/pull/828#discussion_r731460375
##########
File path: src/reporter/pegasus_counter_reporter.cpp
##########
@@ -268,6 +264,13 @@ void pegasus_counter_reporter::update()
// create metrics that prometheus support to report data
metrics_name = lv.front() + app[2];
+
+ // prometheus metric_name don't support characters like .*()@, it only support ":"
+ // and "_"
+ // so change the name to make it all right
+ format_metrics_name(metrics_name);
+
+
Review comment:
```suggestion
```
##########
File path: src/reporter/pegasus_counter_reporter.cpp
##########
@@ -234,22 +234,18 @@ void pegasus_counter_reporter::update()
const dsn::perf_counters::counter_snapshot &cs) {
std::string metrics_name = cs.name;
- // prometheus metric_name don't support characters like .*()@, it only support ":"
- // and "_"
- // so change the name to make it all right
- format_metrics_name(metrics_name);
-
- // split metric_name like "collector_app_pegasus_app_stat_multi_put_qps:1_0_p999" or
- // "collector_app_pegasus_app_stat_multi_put_qps:1_0"
+ // split metric_name like "collector*app.pegasus*app_stat_multi_put_qps@1.0.p999" or
+ // "collector*app.pegasus*app_stat_multi_put_qps@1.0"
Review comment:
```suggestion
// Splits metric_name like:
// "collector*app.pegasus*app_stat_multi_put_qps@1.0.p999"
// "collector*app.pegasus*app_stat_multi_put_qps@1.0"
```
##########
File path: src/reporter/pegasus_counter_reporter.cpp
##########
@@ -268,6 +264,13 @@ void pegasus_counter_reporter::update()
// create metrics that prometheus support to report data
metrics_name = lv.front() + app[2];
+
+ // prometheus metric_name don't support characters like .*()@, it only support ":"
Review comment:
```suggestion
// prometheus metric_name doesn't support characters like .*()@, it only supports ":"
```
##########
File path: src/reporter/pegasus_counter_reporter.cpp
##########
@@ -268,6 +264,13 @@ void pegasus_counter_reporter::update()
// create metrics that prometheus support to report data
metrics_name = lv.front() + app[2];
+
+ // prometheus metric_name don't support characters like .*()@, it only support ":"
+ // and "_"
+ // so change the name to make it all right
Review comment:
```suggestion
// and "_" so change the name to make it all right.
```
--
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@pegasus.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@pegasus.apache.org
For additional commands, e-mail: dev-help@pegasus.apache.org