2

In my company's web application we are using Spring 5, but the application is written in Spring MVC and we are not gonna change it anytime soon. I need to connect the application to Prometheus but I could not find any webpage explaining using Prometheus in Spring MVC. All examples are for Spring Boot, unfortunately.

Can you tell me how to integrate our application to Prometheus?

Best regards,

yyy
  • 437
  • 2
  • 9
  • 23

1 Answers1

0

There's an sample project of Spring (not boot) with prometheus

Enable prometheus using AOP

Add this annotation to any Spring Configuration class to enable * the use of the PrometheusTimeMethod annotation

Ori Marko
  • 56,308
  • 23
  • 131
  • 233
  • I did that configuration already. But the thing is I used @PrometheusTimeMethod annotation in my controller's method but it's showed in Prometheus, What could be the problem? – yyy Jul 20 '20 at 17:58
  • @yyy compare the pom.xml to find missing dependency – Ori Marko Jul 20 '20 at 18:41
  • The project you mentioned is not a example project. It is a library to enable Prometheus in Spring we app. – yyy Jul 27 '20 at 09:41
  • The problem was Prometheus was not setup to listen my web app. I fixed it now. – yyy Jul 27 '20 at 09:42