Marathon

Supported OS Linux Mac OS

통합 버전4.1.0

개요

Agent Marathon 점검을 통해 다음을 수행할 수 있습니다.

  • 모든 애플리케이션의 상태를 추적합니다. 구성된 메모리, 디스크, CPU, 인스턴스를 확인하고 정상 작업과 비정상 작업 수를 모니터링하세요.
  • 대기 중인 애플리케이션 수 및 배포 수 모니터링

설정

설치

Marathon 점검은 Datadog Agent 패키지에 포함되어 있습니다. 서버에 추가 설치가 필요하지 않습니다.

구성

호스트에서 실행 중인 Agent에 대해 이 검사를 구성하려면 아래 지침을 따르세요. 컨테이너화된 환경의 경우 Containerized 섹션을 참조하세요.

호스트

호스트에서 실행 중인 에이전트에 대해 이 점검을 구성하려면:

메트릭 수집
  1. Agent 구성 디렉터리의 루트의 conf.d/ 폴더에 있는 marathon.d/conf.yaml 파일을 편집합니다. 사용 가능한 모든 구성 옵션은 sample marathon.d/conf.yaml을 참조하세요.

    init_config:
    
    instances:
      # the API endpoint of your Marathon master; required
      - url: "https://<SERVER>:<PORT>"
        # if your Marathon master requires ACS auth
        #   acs_url: https://<SERVER>:<PORT>
    
        # the username for Marathon API or ACS token authentication
        username: "<USERNAME>"
    
        # the password for Marathon API or ACS token authentication
        password: "<PASSWORD>"
    

    usernamepassword 의 기능은 acs_url 구성 여부에 따라 달라집니다. 그렇게 하면 Agent는 이를 사용하여 ACS에서 인증 토큰을 요청한 다음 이를 Marathon API에 인증하는 데 사용합니다. 그렇지 않은 경우 Agent는 usernamepassword 를 사용하여 Marathon API에 직접 인증합니다.

  2. 에이전트를 재시작하세요.

로그 수집

Agent 버전 6.0 이상에서 사용 가능

  1. Datadog 에이전트에서 로그 수집은 기본적으로 사용하지 않도록 설정되어 있습니다. datadog.yaml파일에서 로그 수집을 사용하도록 설정합니다.

    logs_enabled: true
    
  2. Marathon은 로그백을 사용하므로 커스텀 로그 형식을 지정할 수 있습니다. Datadog을 사용하면 기본적으로 Marathon에서 제공하는 기본 형식과 Datadog 권장 형식이라는 두 가지 형식이 지원됩니다. 다음 예와 같이 구성에 파일 어펜더를 추가하고 선택한 형식으로 $PATTERN$를 바꿉니다.

    • Marathon 기본값: [%date] %-5level %message \(%logger:%thread\)%n
    • Datadog 권장: %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n
      <?xml version="1.0" encoding="UTF-8"?>
    
      <configuration>
          <shutdownHook class="ch.qos.logback.core.hook.DelayingShutdownHook"/>
          <appender name="stdout" class="ch.qos.logback.core.ConsoleAppender">
              <encoder>
                  <pattern>[%date] %-5level %message \(%logger:%thread\)%n</pattern>
              </encoder>
          </appender>
          <appender name="async" class="ch.qos.logback.classic.AsyncAppender">
              <appender-ref ref="stdout" />
              <queueSize>1024</queueSize>
          </appender>
          <appender name="FILE" class="ch.qos.logback.core.FileAppender">
              <file>/var/log/marathon.log</file>
              <append>true</append>
              <!-- set immediateFlush to false for much higher logging throughput -->
              <immediateFlush>true</immediateFlush>
              <encoder>
                  <pattern>$PATTERN$</pattern>
              </encoder>
          </appender>
          <root level="INFO">
              <appender-ref ref="async"/>
              <appender-ref ref="FILE"/>
          </root>
      </configuration>
    
  3. Marathon 로그 수집을 시작하려면 marathon.d/conf.yaml 파일에 다음 구성 블록을 추가하세요.

    logs:
      - type: file
        path: /var/log/marathon.log
        source: marathon
        service: "<SERVICE_NAME>"
    
  4. 에이전트를 재시작하세요.

컨테이너화

컨테이너화된 환경의 경우 자동탐지 통합 템플릿에 다음 파라미터를 적용하는 방법이 안내되어 있습니다.

메트릭 수집
파라미터
<INTEGRATION_NAME>marathon
<INIT_CONFIG>비어 있음 또는 {}
<INSTANCE_CONFIG>{"url": "https://%%host%%:%%port%%"}
로그 수집

Agent 버전 6.0 이상에서 사용 가능

Datadog Agent에서 로그 수집은 기본값으로 비활성화되어 있습니다. 이를 활성화하려면 쿠버네티스(Kubernetes) 로그 수집을 참조하세요.

파라미터
<LOG_CONFIG>{"source": "marathon", "service": "<SERVICE_NAME>"}

검증

Agent의 상태 하위 명령을 실행하고 Checks 섹션에서 marathon을 찾습니다.

수집한 데이터

메트릭

marathon.apps
(gauge)
Number of applications
marathon.backoffFactor
(gauge)
Backoff time multiplication factor for each consecutive failed task launch; tagged by app_id and version
marathon.backoffSeconds
(gauge)
Task backoff period; tagged by app_id and version
Shown as second
marathon.cpus
(gauge)
Configured CPUs for each instance of a given application
marathon.deployments
(gauge)
Number of running or pending deployments
marathon.disk
(gauge)
Configured CPU for each instance of a given application
Shown as mebibyte
marathon.instances
(gauge)
Number of instances of a given application; tagged by app_id and version
marathon.mem
(gauge)
Configured memory for each instance of a given application; tagged by app_id and version
Shown as mebibyte
marathon.queue.count
(gauge)
Number of instances left to launch
Shown as task
marathon.queue.delay
(gauge)
Wait before the next launch attempt
Shown as second
marathon.queue.offers.processed
(gauge)
The number of processed offers for this launch attempt
Shown as task
marathon.queue.offers.reject.last
(gauge)
Summary of unused offers for all last offers
Shown as task
marathon.queue.offers.reject.launch
(gauge)
Summary of unused offers for the launch attempt
Shown as task
marathon.queue.offers.unused
(gauge)
The number of unused offers for this launch attempt
Shown as task
marathon.queue.size
(gauge)
Number of app offer queues
Shown as task
marathon.taskRateLimit
(gauge)
The task rate limit for a given application; tagged by app_id and version
marathon.tasksHealthy
(gauge)
Number of healthy tasks for a given application; tagged by app_id and version
Shown as task
marathon.tasksRunning
(gauge)
Number of tasks running for a given application; tagged by app_id and version
Shown as task
marathon.tasksStaged
(gauge)
Number of tasks staged for a given application; tagged by app_id and version
Shown as task
marathon.tasksUnhealthy
(gauge)
Number of unhealthy tasks for a given application; tagged by app_id and version
Shown as task

이벤트

Marathon 점검은 이벤트를 포함하지 않습니다.

서비스 점검

marathon.can_connect
CRITICAL if either cannot connect to API endpoint or no instances of any application are running. WARN if no applications are detected. Additional information about response status at the time of collection is included in the check message.
Statuses: ok, critical

트러블슈팅

도움이 필요하신가요? Datadog 지원팀에 문의하세요.