chenBright commented on code in PR #2870: URL: https://github.com/apache/brpc/pull/2870#discussion_r1913245799
########## src/brpc/builtin/prometheus_metrics_service.cpp: ########## @@ -102,9 +103,13 @@ bool PrometheusMetricsDumper::dump(const std::string& name, auto metrics_name = GetMetricsName(name); - *_os << "# HELP " << metrics_name << '\n' - << "# TYPE " << metrics_name << " gauge" << '\n' - << name << " " << desc << '\n'; + if(emitted_metrics.find(metrics_name.as_string()) == emitted_metrics.end()){ + *_os<< "# HELP " << metrics_name <<'\n' + << "# TYPE " << metrics_name <<" gauge\n"; + emitted_metrics.insert(metrics_name.as_string()); + } Review Comment: Some spaces are missing. -- 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-unsubscr...@brpc.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org For additional commands, e-mail: dev-h...@brpc.apache.org