diff --git a/spring-app/src/main/java/com/example/demo/DataController.java b/spring-app/src/main/java/com/example/demo/DataController.java index cbf538a..6261bc3 100644 --- a/spring-app/src/main/java/com/example/demo/DataController.java +++ b/spring-app/src/main/java/com/example/demo/DataController.java @@ -15,9 +15,12 @@ class DataController { return ret; } - @GetMapping("/metrics") + @GetMapping(value = "/metrics", produces = "text/plain") String metrics() { - return "# HELP calls_count Total number of calls\n# TYPE calls_count counter\ncalls_count " + callsCount; + String returnMessage = "# HELP calls_count Total number of calls\n# TYPE calls_count counter\ncalls_count " + + callsCount + "\n"; + callsCount = 0; + return returnMessage; } }