Skip to content

Commit

Permalink
Fix: prometheus metrix endpoint returning empty data (javamelody#1099)
Browse files Browse the repository at this point in the history
Co-authored-by: elnggng <[email protected]>
  • Loading branch information
goldyliang and elnggng committed Mar 24, 2022
1 parent 629f76d commit 74e0b72
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,8 @@ public void doActionIfNeededAndReport(HttpServletRequest httpRequest,
}

doReport(httpRequest, httpResponse, Collections.singletonList(javaInformations));

httpResponse.flushBuffer();
}

public void doReport(HttpServletRequest httpRequest, HttpServletResponse httpResponse,
Expand Down Expand Up @@ -247,6 +249,8 @@ public void doPrometheus(HttpServletResponse httpResponse,
final PrometheusController prometheusController = new PrometheusController(
javaInformationsList, collector, httpResponse.getWriter());
prometheusController.report(includeLastValue);

httpResponse.getWriter().flush();
}

public static void noCache(HttpServletResponse httpResponse) {
Expand Down

0 comments on commit 74e0b72

Please sign in to comment.