How to integrate prometheus?
1. Add pom dependencies
Note: The version of prometheus depends on the version of springboot, and the version of springboot used in the example is 2.3.X.
2. Add configuration to the configuration file
3. Add the following configuration to the main startup class
4. Verify endpoint
The SpringBoot project is configured here. Start the project and visit http://localhost:port/actuator/prometheus. As shown in the figure, you can see some metrics.