This topic describes how to expose Remote Procedure Call (RPC) monitoring metrics using Prometheus.
Prerequisites
Use SOFABoot version 3.10.3 or later.
Procedure
Add the following dependency to your project that uses SOFARPC:
ImportantDo not specify the version. The dependencyManagement element controls the version.
<dependency> <groupId>io.micrometer</groupId> <artifactId>micrometer-registry-prometheus</artifactId> </dependency>Adding this dependency automatically activates the Prometheus metrics for RPC.
Add the following configuration to the
application.propertiesfile to expose the Actuator Prometheus endpoint.management.endpoints.web.exposure.include=prometheus,<Other endpoints>
After the project starts, you can access the Prometheus monitoring metrics through Actuator. The SOFARPC monitoring metrics will be included.
If the preceding steps do not resolve the issue, perform the following steps:
Check if your project includes spring-boot-starter-actuator. If not, add it.
Check if the open source SOFARPC version in your project is later than 5.9.1. If the version is earlier, modify or remove the SOFARPC version specification.
NoteSOFABoot 3.10.3 uses open source SOFARPC version 5.11.1.