Skip to main content

springboot3

Collect and monitor the general performance metrics exposed by the SpringBoot 3.0 actuator.

Pre-monitoring operations

If you want to monitor information in 'SpringBoot' with this monitoring type, you need to integrate your SpringBoot application and enable the SpringBoot Actuator.

1、Add POM .XML dependencies:

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>

2. Modify the YML configuration exposure metric interface:

management:
endpoints:
web:
exposure:
include: '*'
enabled-by-default: on

Note: If your project also introduces authentication related dependencies, such as springboot security, the interfaces exposed by SpringBoot Actor may be intercepted. In this case, you need to manually release these interfaces. Taking springboot security as an example, you should add the following code to the Security Configuration class:

public class SecurityConfig extends WebSecurityConfigurerAdapter{
@Override
protected void configure(HttpSecurity httpSecurity) throws Exception{
httpSecurity
// Configure the interfaces to be released -----------------------------------
.antMatchers("/actuator/**").permitAll()
.antMatchers("/metrics/**").permitAll()
.antMatchers("/trace").permitAll()
.antMatchers("/heapdump").permitAll()
// ...
// For other interfaces, please refer to: https://blog.csdn.net/JHIII/article/details/126601858 -----------------------------------
}
}

Configuration Parameters

Parameter NameParameter Description
Monitor HostThe monitored peer's IPV4, IPV6, or domain name. Note⚠️: Do not include protocol headers (eg: https://, http://).
Task NameIdentifies the name of this monitor, ensuring uniqueness is necessary.
PortThe port provided by the application service, default is 8080.
Enable SSLWhether to access the website via HTTPS. Note⚠️: Enabling HTTPS generally requires changing the default port to 443.
CollectorSpecifies which collector to use for scheduling data collection for this monitor.
Monitoring PeriodInterval for periodically collecting data, in seconds, with a minimum interval of 30 seconds.
Bind TagsTags for categorizing and managing monitored resources.
DescriptionAdditional identification and description for this monitor, where users can add remarks.

Collection Metrics

Metric Set: Availability

Metric NameUnitMetric Description
responseTimemsResponse time

Metric Set: Threads

Metric NameUnitMetric Description
stateNoneThread state
sizeNoneNumber of threads for this state

Metric Set: Memory Usage

Metric NameUnitMetric Description
spaceNoneMemory space name
mem_usedMBMemory usage for this space

Metric Set: Health Status

Metric NameUnitMetric Description
statusNoneService health status: UP, Down