Copilot commented on code in PR #3549:
URL: https://github.com/apache/brpc/pull/3549#discussion_r4033505431


##########
src/brpc/builtin/prometheus_metrics_service.cpp:
##########
@@ -181,6 +181,12 @@ bool PrometheusMetricsDumper::DumpLatencyRecorderSuffix(
     if (!si->IsComplete()) {
         return true;
     }
+    // The average latency can not be a quantile series of the summary below,
+    // because the quantile label must be parsable as a float. Dump it as a
+    // separate gauge, which is the same as the multi dimension one does.
+    *_os << "# HELP " << si->metric_name << "_avg_latency" << '\n'
+         << "# TYPE " << si->metric_name << "_avg_latency gauge\n"
+         << si->metric_name << "_avg_latency " << si->latency_avg << '\n';

Review Comment:
   The PR description specifies `N_latency_average`, but this emits 
`N_avg_latency` (and the multi-dimensional path/tests use that name). Since 
this is a new exported metric name, the implementation and stated contract 
should agree before merging.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to