eolivelli commented on a change in pull request #13380:
URL: https://github.com/apache/pulsar/pull/13380#discussion_r772127979
##########
File path:
pulsar-broker/src/main/java/org/apache/pulsar/broker/stats/prometheus/PrometheusMetricsServlet.java
##########
@@ -70,19 +71,38 @@ protected void doGet(HttpServletRequest request,
HttpServletResponse response)
AsyncContext context = request.startAsync();
context.setTimeout(metricsServletTimeoutMs);
executor.execute(safeRun(() -> {
+ long start = System.currentTimeMillis();
HttpServletResponse res = (HttpServletResponse)
context.getResponse();
try {
res.setStatus(HttpStatus.OK_200);
res.setContentType("text/plain");
PrometheusMetricsGenerator.generate(pulsar,
shouldExportTopicMetrics, shouldExportConsumerMetrics,
shouldExportProducerMetrics,
splitTopicAndPartitionLabel, res.getOutputStream(),
metricsProviders);
- context.complete();
-
} catch (Exception e) {
- log.error("Failed to generate prometheus stats", e);
Review comment:
is it a really bad error and we must see this in production (and we also
need the full stacktrace)
if we are not able to generate metrics (that should be a very light weight
process) these is some action to take, if we leave DEBUG nobody will probably
notice
--
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]