엔드포인트를 활성화 = 해당 기능자체를 사용할지 말지 on, off 선택하는것
엔드포인트를 노출 = http ,JMX 중 선택
management:
info:
java:
enabled: true
os:
enabled: true
env:
enabled: true
endpoint:
shutdown:
enabled: true
health:
show-components: always
endpoints:
web:
exposure:
include: "*"
info:
app:
name: hello-actuator
company: yh
굉장히 많은것들이 기본으로 제공이된다.
env 의 경우 info.app~ 처럼 info로 시작하게 되면 외부설정으로 인식하여 다 읽어오게 된다.
springBoot {
buildInfo()
}
build.gradle에 추가후 빌드하게 되면
build.artifact=actuator
build.group=hello
build.name=actuator
build.time=2023-05-16T02\:31\:27.739936875Z
build.version=0.0.1-SNAPSHOT
build/resource/main/META-INF/build.-info.properties 에 추가된다.
"build": {
"artifact": "actuator",
"name": "actuator",
"time": "2023-05-16T02:32:51.039Z",
"version": "0.0.1-SNAPSHOT",
"group": "hello"
},
/actuator/info 에 build 관련 정보가 추가 된다.
loggers 엔드포인트를 사용하면 실시간으로 로그 레벨을 변경할 수 있다.
POST /actuator/loggers/{package.classname}
"configuredLevel" : "TRACE" 이런식으로 BODY 에 원하는 level을 적어서 요청을 보내게 되면 trace로 변경되어 trace레벨 이상 로그들이 다 찍히게 된다.
/actuator 는 내부망에서만 접근이 가능하도록 설정해야 한다.
management.server.port=9292 처럼 내부망에서만 접근하는 포트로 설정을 해줘야 한다.
'WEB > Spring Boot' 카테고리의 다른 글
마이크로미터, 프로메테우스, 그라파나 (0) | 2023.05.18 |
---|---|
외부설정과 프로필 (0) | 2023.05.14 |
자동 구성(Auto Configuration) (0) | 2023.05.13 |
스프링 부트 스타터와 라이브러리 관리 (0) | 2023.05.11 |
스프링 부트와 내장 톰캣 (0) | 2023.05.10 |