OpenAgent 설치
OpenAgent는 Prometheus 엔드포인트에서 메트릭을 수집하여 와탭 서버로 전송하는 에이전트입니다. 본 문서는 리눅스 호스트에 OpenAgent를 설치하고 실행하는 전체 절차를 설명합니다.
OpenAgent 동작에 필요한 파일은 다음 세 가지입니다.
- openagent: 메트릭 수집 및 전송 실행 파일
- whatap.conf: 에이전트의 기본 설정 파일 (라이센스, 서버 주소 등)
- scrape_config.yaml: 스크래핑 타겟 정의 파일
설치 이후 상세 설정은 OpenAgent 설정 문서를 참고하세요.
쿠버네티스 환경에서 OpenAgent를 설치하려는 경우, 별도의 OpenAgent 쿠버네티스 구성 문서를 참고하세요. 본 문서는 리눅스 호스트(바이너리) 설치를 기준으로 작성되어 있습니다.
사전 준비 사항
OpenAgent를 설치하기 전에 다음 사항을 준비하세요.
- 와탭 프로젝트의 액세스 키(라이센스)
- 와탭 수집 서버 호스트 주소와 포트(기본값 6600)
- 리눅스 호스트 환경 (AMD64 또는 ARM64)
- 수집할 Prometheus 엔드포인트 정보 (주소, 포트, 메트릭 경로)
macOS Apple Silicon은 지원되지 않습니다. Linux AMD64(Intel/AMD 64비트) 또는 Linux ARM64에서만 동작합니다.
에이전트 다운로드
설치 디렉터리 생성
OpenAgent 관련 파일은 모두 하나의 디렉터리 안에 배치하는 것을 권장합니다. 설치 디렉터리를 생성하고 해당 경로로 이동하세요.
mkdir -p /opt/whatap/openagent
cd /opt/whatap/openagent
바이너리 다운로드
CPU 아키텍처에 맞는 바이너리를 다운로드합니다.
AMD64 (Intel/AMD 64비트)
wget https://repo.whatap.io/openagent/latest/amd/openagent
ARM64 (Linux ARM 프로세서)
wget https://repo.whatap.io/openagent/latest/arm/openagent
실행 권한 설정
다운로드한 바이너리에 실행 권한을 부여하세요.
chmod +x openagent
에이전트 설치 파일 구성
설치가 완료되면 아래와 같은 디렉터리 구조를 가지게 됩니다.
/opt/whatap/openagent/
├── openagent # 실행 파일
├── whatap.conf # 기본 설정 파일
└── scrape_config.yaml # 스크래핑 타겟 설정 파일
- openagent: 메트릭 수집 및 전송을 담당하는 실행 파일입니다.
- whatap.conf: 라이센스, 수집 서버 정 보, 로그 레벨 등 에이전트 동작의 기본 설정을 담는 파일입니다.
- scrape_config.yaml: 어떤 Prometheus 엔드포인트로부터 메트릭을 수집할지 정의하는 파일입니다.
whatap.conf 기본 정보 입력
OpenAgent는 최소한 라이센스 키와 서버 주소가 설정돼 있어야 동작합니다. 설치 디렉터리 안에 whatap.conf 파일을 생성하고 아래 내용을 작성하세요.
echo "WHATAP_LICENSE=your-whatap-license" >> whatap.conf
echo "WHATAP_HOST=your-whatap-host" >> whatap.conf
echo "WHATAP_PORT=your-whatap-port" >> whatap.conf
완성된 whatap.conf 예시는 다음과 같습니다.
license=xxxxxxxxxxxxx-xxxxxxxxxx-xxxxxxxxxxxxx
whatap.server.host=10.10.0.1
whatap.server.port=6600
로그 레벨, 환경변수 매핑, 디버그 옵션 등 상세 설정은 OpenAgent 설정 문서를 참고하세요.
scrape_config.yaml 기본 설정
설치 디렉터리 안에 scrape_config.yaml 파일을 생성하고 수집할 엔드포인트를 정의합니다. 아래는 가장 단순한 형태인 StaticEndpoints 예시입니다.
features:
openAgent:
enabled: true
targets:
- targetName: dcgm-exporter
type: StaticEndpoints
enabled: true
endpoints:
- address: "192.168.49.2:30400"
path: "/metrics"
scheme: "http"
interval: "30s"
metricRelabelConfigs:
- source_labels: [__name__]
regex: "DCGM.*"
action: keep
PodMonitor, ServiceMonitor, params, metricRelabelConfigs 등 상세 설정은 OpenAgent 설정 문서의 스크래핑 타겟 설정 섹션을 참고하세요. scrape_config.yaml 파일은 수정 시 자동으로 변경사항이 감지되며 에이전트 재시작이 불필요합니다.
에이전트 실행
설정이 완료되면 OpenAgent 를 실행합니다.
기본 실행 (standalone)
./openagent standalone
백그라운드 실행 (nohup)
서비스 환경에서는 백그라운드로 실행하고 로그를 파일로 저장합니다.
nohup ./openagent standalone > /dev/null 2>&1 &
로그 확인
tail -f logs/whatap-boot-{yyyymmdd}.log
프로세스 관리
# 프로세스 확인
ps aux | grep openagent
# 프로세스 종료
pkill openagent
실행 모드
OpenAgent는 시작 인자에 따라 동작 모드를 구분합니다.
- 기본(worker) 모드: 인자 없이 실행하면 바로 워커로 동작합니다.
- foreground 모드:
./openagent foreground- 부모 프로세스와 연동되는 워커 모드로 실행됩니다. - standalone 모드:
./openagent standalone또는./openagent foreground standalone- 쿠버네티스 ConfigMap 감시 없이 로컬scrape_config.yaml만 사용합니다.
쿠버네티스 환경이 아닌 호스트에 OpenAgent를 설치할 때는 주로 standalone 모드를 사용합니다.
Kubernetes 환경에서 설치하려면 오픈에이전트 구성 문서를 참고하세요.
오픈에이전트 바이너리 실행 파일 설치
모든 파일은 하나의 디렉토리에 위치해야 합니다.
## 예시
/opt/whatap/openagent/
├── openagent # 실행 파일
├── whatap.conf # 설정 파일
└── scrape_config.yaml # 스크래핑 설정 파일
디렉토리 이동 및 실행 파일 다운로드
mkdir -p /opt/whatap/openagent
cd /opt/whatap/openagent
## AMD64 (Intel/AMD 64비트 프로세서)
wget https://repo.whatap.io/openagent/latest/amd/openagent
## ARM64 (Linux 환경의 ARM 프로세서)
## ⚠️ macOS Apple Silicon 미지원
wget https://repo.whatap.io/openagent/latest/arm/openagent
실행 권한 설정
chmod +x openagent
설정 파일 생성(whatap.conf)
# 실제 값으로 교체해서 입력하세요
echo "WHATAP_LICENSE=your-whatap-license" >> whatap.conf
echo "WHATAP_HOST=your-whatap-host" >> whatap.conf
echo "WHATAP_PORT=your-whatap-port" >> whatap.conf
# 디버그시
# echo "debug=true" >> whatap.conf
# echo "log_level=debug" >> whatap.conf
스크래핑 설정 파일 생성(scrape_config.yaml)
scrape_config.yaml 파일을 수정하면 OpenAgent가 자동으로 변경 사항을 감지하고 설정을 재로드합니다. 별도의 재시작이 필요하지 않습니다.
#scrape_config.yaml
features:
openAgent:
enabled: true
targets:
- targetName: dcgm-exporter
type: StaticEndpoints
# Target is enabled by default (enabled: true), this can be omitted
enabled: true
endpoints:
- address: "192.168.49.2:30400"
path: "/metrics"
scheme: "http"
interval: "30s"
metricRelabelConfigs:
- source_labels: [ __name__ ]
regex: "DCGM.*"
action: keep
기본 실행
./openagent standalone
백그라운드 실행
nohup ./openagent standalone > openagent.log 2>&1 &
로그 확인
tail -f openagent.log
프로세스 관리
# 프로세스 확인
ps aux | grep openagent
# 프로세스 종료
pkill openagent
StaticEndpoints 설정 요소
-
targetName: 타겟 식별자
-
type: 타겟 유형 ("StaticEndpoints")
-
endpoints: 수집 대상
-
address: IP:PORT 또는 HOSTNAME:PORT -
path: 메트릭 경로 (기본값: /metrics) -
scheme: 프로토콜 (http 또는 https, 기본값: http) -
interval: 수집 주기 (기본값: 60s) -
metricRelabelConfigs: 메트릭 재라벨링 설정
-
params 기능 설정
OpenAgent에 params 기능을 사용하면 HTTP 스크래핑 시 URL에 쿼리 파라미터를 추가할 수 있습니다. Azure Monitor Exporter 등 외부 서비스 연동 시 유용합니다.
endpoints:
- address: "192.168.49.2:30400"
path: "/metrics"
scheme: "http"
interval: "30s"
params:
subscription: ["50d91b57-a280-45b5-8d7c-be8005662738"]
resourceGroup: ["WhaTap-Data-KR-MID"]
target: ["/subscriptions/50d91b57-a280-45b5-8d7c-be8005662738/resourceGroups/WhaTap-Data-KR-MID/providers/Microsoft.Sql/managedInstances/openmetrics-instance-01"]
metric: ["avg_cpu_percent,virtual_core_count,memory_usage_percent"]
interval: ["PT1M"]
aggregation: ["average"]
-
지원되는 파라미터 값 타입
- 문자열: 단일 값