This tutorial shows you how you can visualise JVM metrics from Spring boot applications in SigNoz

In this tutorial, we use Micrometer and Springboot actuator to expose JVM metrics in Prometheus format. Then we update OpenTelemetry collector which comes pre-installed with SigNoz to be able to scrape these metrics.

Post that you can plot the JVM metrics which are relevant for your team by creating dashboards in SigNoz.

Steps to be followed

  1. Add the following extra lines in springboot app

Change the following in pom.xml

		<dependency>
			<groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
      <groupId>io.micrometer</groupId>
      <artifactId>micrometer-registry-prometheus</artifactId>
      <scope>runtime</scope>
    </dependency>

Add the following in src/main/resources/application.properties

management.endpoints.web.exposure.include=*
management.endpoints.web.exposure.include=prometheus,health,info,metric

management.health.probes.enabled=true
management.endpoint.health.show-details=always
management.endpoint.prometheus.enabled=true

Sample Springboot application with needed changes

https://github.com/SigNoz/spring-petclinic/commit/5c4d041d43c5b1b0d07ea3bc9f0ad9a3a8b49526