SpringBoot series--[How to integrate prometheus? 】

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.

Guess you like

Origin blog.csdn.net/weixin_44988127/article/details/131821706