일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | |||||
3 | 4 | 5 | 6 | 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | 16 |
17 | 18 | 19 | 20 | 21 | 22 | 23 |
24 | 25 | 26 | 27 | 28 | 29 | 30 |
31 |
- amazon-ecr-login
- Spring Authorization Server
- 백준
- Session Registry
- 프로그래머스
- SpringCloudConfig
- 15686
- openTelemetry
- aws-mysql-jdbc
- HttpRequestMethodNotSupportedException
- 12100
- ConcurrentSessionControlAuthenticationStrategy
- 1916
- Spring Security
- 14889
- self-hosted runners
- tailsamplingprocessor
- Java
- 17144
- RestControllerAdvice
- github actions
- AWS
- 1260
- Session Fixation Protection
- Spring
- Value annotation
- RequiredArgsConstructor
- github
- 14891
- 자바
- Today
- Total
한울이
[APM] Scouter 본문
개요
오픈소스 APM인 Scouter는 JVM(WAS, Standalone application)을 사용하는 어플리케이션 및 OS 자원에 대한 모니터링 모니터링 기능을 제공한다.
구성모듈
Agent: 성능 데이터를 수집하여 수집 서버로 전송
Server (Collector): Agent가 전송한 데이터를 저장하고 Client 요청시 Client에게 적절한 데이터를 전송
Client (Viewer): 수집된 데이터를 보기 위한 RCP 기반 Client 프로그램. (OSX Big Sur 미지원)
Web API (Since @1.8.0) : 성능 카운터, XLog, 프로파일등의 정보를 HTTP 프로토콜을 통해 제공
적용
Requirement
JDK 7+ (& JAVA_HOME 환경변수 설정)
Windows / Linux / OS X
1. 통합 개발환경 및 클라이언트 프로그램 다운로드
- https://github.com/scouter-project/scouter/releases
scouter-all-xxx.SNAPSHOT.tar.gz (Collector Server, Host Agent, Java Agent, Tomcat, 샘플 시스템, 설정, 기동 스크립트가 포함됨)
scouter.client.product-macosx.cocoa.x86_64.tar.gz
2. Server 실행
- cd ~/demo-env1
./start-scouter-server.sh
3. Client 실행
- scouter.client.app 더블클릭
- Collector Server의 IP 를 127.0.0.1:6100, id/password를 admin/admin을 입력하여 로그인
* Big Sur는 Client 프로그램 미지원 → ScoutPaper 사용
- https://github.com/scouter-contrib/scouter-paper/releases 에서 scouter-paper 다운로드
- 압축해제 후 /Users/hanul/scouter/server/extweb 으로 복사
Embedded Mode로 실행 - 수집서버(Collector)에서 실행
수집서버에 아래 옵션을 설정하면 수집서버와 같이 실행된다.(재기동 필요)
net_http_server_enabled : set true
net_http_api_enabled : set true
net_http_port : default value 6180
net_http_api_allow_ips : default value localhost,127.0.0.1,0:0:0:0:0:0:0:1,::1
net_collector_ip_port_id_pws : default value 127.0.0.1:6100:admin:admin
StandAlone Mode로 실행
Web API는 Servlet을 통해 서비스 되면 HTTP 프로토콜이나 JSON 파싱 등 부가적인 작업이 필요하기 때문에 기본 수집서버에 비해 자원 사용량이 높다. 따라서 모니터링하는 시스템의 규모가 크다면 API 서버를 분리하여 실행할 필요가 있다.
standAlone webapp 실행 (Scouter Full 패키지에 포함되어 있음)
cd ~/scouter/webapp
./startup.sh
scouter web app 설정 (실행전에 설정 필요)
net_collector_ip_port_id_pws : default value 127.0.0.1:6100:admin:admin
format : {host}:{port}:{id}:{pw},{host}:{port}:{id}:{pw}
net_http_port : default value 6188
net_http_api_allow_ips : default value localhost,127.0.0.1,0:0:0:0:0:0:0:1,::1;
------------------------------------------------------------------------------------
4. java Agent 설정 및 host Agent 실행
- vi ~/demo-env1/scouter/agent.java/conf/프로젝트명.conf
obj_name=프로젝트명
net_collector_ip=127.0.0.1
net_collector_udp_port=6100
net_collector_tcp_port=6100
profile_http_header_enabled=true
profile_http_parameter_enabled=true
profile_http_querystring_enabled=true
profile_spring_controller_method_parameter_enabled=true
- cd ~/demo-env1
./start-scouter-host.sh
5. spring boot 프로젝트 실행
VM options: -javaagent:/Users/hanul/demo-env1/scouter/agent.java/scouter.agent.jar -Dscouter.config=/Users/hanul/demo-env1/scouter/agent.java/conf/프로젝트명.conf
6. Client 프로그램에서 확인
*ScoutPaper는 http://localhost:6180/extweb/index.html 접속
(Embedded Mode로 실행시 SETTING → SCOUTER WEB API SERVER INFO의 포트 6180으로 변경)
참고: https://github.com/scouter-project/scouter
'PROGRAMMING' 카테고리의 다른 글
[SPRING] Spring Cloud Config override (0) | 2022.08.21 |
---|---|
[SPRING] Spring Reactive Programming (0) | 2022.08.20 |
[OTP] One Time Password (0) | 2022.08.20 |
[DOCKER] cache gradle dependencies (0) | 2022.08.20 |
[SPRING] @Value annotation (0) | 2022.08.20 |