1. 의존성 주입
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-actuator</artifactId>
</dependency>
<dependency>
<groupId>io.micrometer</groupId>
<artifactId>micrometer-registry-prometheus</artifactId>
</dependency>
implementation group: 'org.springframework.boot', name: 'spring-boot-starter-actuator'
implementation group: 'io.micrometer', name: 'micrometer-registry-prometheus'
2. properties 설정 추가
# Actuator setting sample
# 1. Endpoint all disable
management.endpoints.enabled-by-default = false
# 2. Enable specific endpoints
management.endpoint.info.enabled = true
management.endpoint.health.enabled = true
# 3. Exclude all endpoint for JMX and Expose specific endpoints
management.endpoints.jmx.exposure.exclude = *
management.endpoints.jmx.exposure.include = info, health, metrics, prometheus
management.endpoints.web.exposure.include = info, health, metrics, prometheus
# 4. Use other port for Actuator
management.server.port = 8080
# 5. Change Actuator Default path
management.endpoints.web.base-path = /test
# 6.
management.endpoint.health.show-details = always
# 7.
management.endpoint.prometheus.enabled=true