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 74dbfd0..cbf538a 100644 --- a/spring-app/src/main/java/com/example/demo/DataController.java +++ b/spring-app/src/main/java/com/example/demo/DataController.java @@ -5,12 +5,20 @@ import org.springframework.web.bind.annotation.RestController; @RestController class DataController { + private static int callsCount = 0; + @GetMapping("/data") SomeData get() { + callsCount++; var ret = new SomeData(); ret.setName("ILV Microservice Architecture"); return ret; } + + @GetMapping("/metrics") + String metrics() { + return "# HELP calls_count Total number of calls\n# TYPE calls_count counter\ncalls_count " + callsCount; + } } class SomeData {