본문 바로가기
Monitoring/Datadog

[모니터링] Datadog | Agent 설치 및 연동 방법

by 인프라보이 2022. 9. 20.

Datadog으로 wordpress와 zabbix 서비스 대상으로 연동하는 방법입니다.

Datadog은 제일 먼저 서버에 Agent를 설치하고 시작을 해야 합니다.
Infrastructure에 등록된 호스트 수로 라이선스가 차감되는 방식이며, 추가적인 Integration은 전부 무료입니다. 
만약 EC2에 Agent를 설치하면, Infrastructure 카운트에 1개 서버가 잡히면 비용이 발생되고,
AWS AccessKey로 AWS를 Integration으로 연동하면 무료입니다. (단, AWS에서 Datadog으로 나가는 Outbound는 유료)

Datadog Agent는 서버에 설치 후 약 5분 이내에 Datadog에 등록되는 것처럼 보입니다.

1. Server OS에 Datadog Agent 설치

 

2. Agent가 설치되면 Datadog Infrastructure List에 아래와 같이 등록 됨

 

3. 추가 Integration (Apache, MySQL 등) 연동하게 되면 아래와 같이 Infrastructure List에 APPS가 추가되어 보임.

[Apache 연동 방법]
  1. RHEL계열 리눅스 기준
      /etc/datadog-agent/datadog.yaml 파일 수정

##################################
## Log collection Configuration ##
##################################

## @param logs_enabled - boolean - optional - default: false
## @env DD_LOGS_ENABLED - boolean - optional - default: false
## Enable Datadog Agent log collection by setting logs_enabled to true.
#
logs_enabled: true

## @param logs_config - custom object - optional
## Enter specific configurations for your Log collection.
## Uncomment this parameter and the one below to enable them.
## See https://docs.datadoghq.com/agent/logs/
#
logs_config:

  ## @param container_collect_all - boolean - optional - default: false
  ## @env DD_LOGS_CONFIG_CONTAINER_COLL

      /etc/datadog-agent/conf.d/apache.d/conf.yaml 

## Every instance is scheduled independent of the others.
#
instances:

    ## @param apache_status_url - string - required
    ## Status url of your Apache server.
    #
  - apache_status_url: http://localhost/server-status

기본적으로 설치된 apache의 httpd.conf는 status_url이 활성화 되어 있지 않아 아래와 같이 httpd.conf 하단에 추가해주고 재기동 해줍니다.

<Location /server-status>
SetHandler server-status

Order Deny,Allow
Deny from example.com
Allow from all
</Location>

http://example.com/server-status 로 접속하면 아래와 같이 나타납니다.

 

4. Apache가 정상적으로 연동되면 Infrastructure List 우측 APPS내역에 표기됨

 Metrics 내역에서 Server System Metric과 Apache Metric을 한번에 볼 수 있음.

5. Agent yaml파일에 APM을 enable하면 아래와 같이 APM 모니터링도 가능

 단, APM은 별도 라이선스가 필요함

 

6. Integration에서 Apache를 활성화 하면 보이는 Apache 전용 Dashboard를 활용

 

Datadog은 위와 같이 Sample Dashboard를 제공하는데, 본인이 직접 Custom이 가능하여 원하는 위젯만 가져와서 별도의 모니터링 대시보드를 만들 수 있습니다.

특정 module을 활성화하면 5~10분 정도 수집시간이 필요하여, Agent 재기동 후 잠시 뒤에 Datadog 화면에 활성화 된 것을 볼 수 있습니다. Datadog은 특이사항이 발생된 시점의 모든 Metric을 한번에 보기 쉬워 추적하는데 큰 장점입니다.

728x90

'Monitoring > Datadog' 카테고리의 다른 글

[모니터링] Datadog | Azure 리소스 모니터링 구성  (0) 2021.08.23

댓글