Nginx

Supported OS Linux Windows Mac OS

통합 버전8.1.0

NGINX 기본값 대시보드

개요

Datadog 에이전트는 다음을 포함하되 이에 국한되지 않는 많은 메트릭을 NGINX 인스턴스로부터 수집할 수 있습니다.

  • 총 요청
  • 수락, 처리, 활성 등의 연결

NGINX의 상용 버전인 NGINX Plus 사용자의 경우, 에이전트에서 NGINX Plus가 제공하는 더 많은 메트릭을 수집할 수 있습니다.

  • 4xx 코드 및 5xx 코드와 같은 오류
  • 활성 연결, 5xx 코드 및 상태 점검과 같은 업스트림 서버
  • 크기, 히트, 미스 등 캐시
  • 핸드셰이크 및 실패한 핸드셰이크와 같은 SSL

설정

설치

NGINX 점검은 로컬 NGINX 상태 엔드포인트에서 메트릭을 가져오므로 nginx 바이너리는 NGINX 상태 모듈로 컴파일해야 합니다.

NGINX 오픈 소스

오픈 소스 NGINX를 사용하는 경우 인스턴스에 스텁 상태 모듈이 없을 수 있습니다. **설정 ** 진행 전에 nginx 바이너리에 해당 모듈이 포함되어 있는지 확인하세요.

$ nginx -V 2>&1| grep -o http_stub_status_module
http_stub_status_module

명령 출력에 http_stub_status_module이 포함되지 않으면 해당 모듈이 포함된 NGINX 패키지를 설치해야 합니다. 직접 NGINX를 컴파일하여 모듈을 활성화할 수도 있지만, 대부분의 최신 리눅스(Linux) 배포에서는 다양한 추가 모듈 조합이 내장된 대체 NGINX 패키지를 제공합니다. 운영 체제의 NGINX 패키지를 확인하여 스텁 상태 모듈이 포함된 패키지를 찾으세요.

NGINX Plus

릴리스 13 이전의 NGINX Plus 패키지에는 http 상태 모듈이 포함되어 있습니다. NGINX Plus 릴리스 13 이상의 경우 상태 모듈은 더 이상 사용되지 않으며 대신 새로운 Plus API 를 사용해야 합니다. 자세한 내용은 공지사항을 참조하세요.

NGINX 준비

각 NGINX 서버에서 다른 NGINX 설정 파일(예: /etc/nginx/conf.d/)이 포함된 디렉터리에 status.conf 파일을 생성합니다.

server {
  listen 81;
  server_name localhost;

  access_log off;
  allow 127.0.0.1;
  deny all;

  location /nginx_status {
    # Choose your status module

    # freely available with open source NGINX
    stub_status;

    # for open source NGINX < version 1.7.5
    # stub_status on;

    # available only with NGINX Plus
    # status;

    # ensures the version information can be retrieved
    server_tokens on;
  }
}

NGINX Plus

NGINX Plus 사용자도 stub_status를 사용할 수 있지만 해당 모듈이 제공하는 메트릭 이 적기 때문에 Datadog에서는 status를 사용할 것을 권장합니다.

NGINX Plus 릴리스 15 이상에서는 status 모듈이 더 이상 사용되지 않습니다. 대신 http_api_module을 사용하세요. 예를 들어, 기본 NGINX 설정 파일(/etc/nginx/conf.d/default.conf)에서 /api 엔드포인트를 활성화합니다.

server {
  listen 8080;
  location /api {
    api write=on;
  }
}

더 자세한 메트릭(예: 초당 2xx / 3xx / 4xx / 5xx 응답 개수)을 얻으려면 모니터링하려는 서버에 status_zone를 설정하세요. 예시:

server {
  listen 80;
  status_zone <ZONE_NAME>;
  ...
}

NGINX를 다시 로드하여 상태 또는 API 엔드포인트를 활성화합니다. 완전히 다시 시작할 필요는 없습니다.

sudo nginx -t && sudo nginx -s reload

메트릭 엔드포인트를 다른 포트에 노출하려면 설정 구성 맵에 다음 스니펫을 추가하세요.

kind: ConfigMap
metadata:
  name: nginx-conf
data:
[...]
  status.conf: |
    server {
      listen 81;

      location /nginx_status {
        stub_status on;
      }

      location / {
        return 404;
      }
    }    

그런 다음 NGINX 포드에서 81 엔드포인트를 노출하고 해당 파일을 NGINX 설정 폴더에 마운트합니다.

spec:
  containers:
    - name: nginx
      ports:
        - containerPort: 81
      volumeMounts:
        - mountPath: /etc/nginx/conf.d/status.conf
          subPath: status.conf
          readOnly: true
          name: "config"
  volumes:
    - name: "config"
      configMap:
          name: "nginx-conf"

구성

호스트

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

호스트에서 실행되는 경우 아래 지침에 따라 이 점검을 설정하세요. 컨테이너화된 환경 경우 도커(Docker), 쿠버네티스(Kubernetes) 또는 ECS 섹션을 참조하세요.

메트릭 수집
  1. nginx.d/conf.yaml 파일에서 nginx_status_url 파라미터를 http://localhost:81/nginx_status/로 설정하여 NGINX 메트릭 수집을 시작합니다. 사용 가능한 모든 설정 옵션은 샘플 nginx.d/conf.yaml을 참조하세요.

    NGINX Plus:

    • NGINX Plus 릴리스 13 이상의 경우 nginx.d/conf.yaml 설정 파일에서 파라미터 use_plus_apitrue로 설정하세요.

    • Stream stats API 호출은 NGINX Plus에 기본적으로 포함됩니다. 사용하지 않으려면 nginx.d/conf.yaml 설정 파일에서 파라미터 use_plus_api_streamfalse로 설정하세요.

    • 예를 들어 http_api_module을 사용하는 경우 파라미터 nginx_status_url을 서버의 /api 위치로 설정합니다(예: nginx.d/conf.yaml 설정 파일).

      nginx_status_url: http://localhost:8080/api
      
  2. 선택 사항 - NGINX vhost_traffic_status module을 사용하는 경우 nginx.d/conf.yaml 설정 파일에서 파라미터 use_vtstrue로 설정합니다.

  3. 에이전트를 다시 시작하여 NGINX 메트릭을 Datadog로 전송하기 시작합니다.

로그 수집

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

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

    logs_enabled: true
    
  2. 이 설정 블록을 nginx.d/conf.yaml 파일에 추가하여 NGINX 로그 수집을 시작하세요.

    logs:
      - type: file
        path: /var/log/nginx/access.log
        service: nginx
        source: nginx
    
      - type: file
        path: /var/log/nginx/error.log
        service: nginx
        source: nginx
    

    path 파라미터 값을 변경하고 환경을 설정하세요. 사용 가능한 모든 설정 옵션은 샘플 nginx.d/conf.yaml을 참조하세요.

  3. Agent를 재시작합니다.

참고: 기본 NGINX 로그 형식에는 요청 응답 시간이 없습니다. 로그에 포함하려면 NGINX 로그 형식을 업데이트하여 NGINX 설정 파일의 http 섹션에 다음 설정 블록을 추가하세요(/etc/nginx/nginx.conf).

http {
    #recommended log format
    log_format nginx '\$remote_addr - \$remote_user [\$time_local] '
                  '"\$request" \$status \$body_bytes_sent \$request_time '
                  '"\$http_referer" "\$http_user_agent"';

    access_log /var/log/nginx/access.log;
}

Docker

컨테이너에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

애플리케이션 컨테이너에서 자동탐지 통합 템플릿을 Docker 레이블로 설정합니다.

LABEL "com.datadoghq.ad.check_names"='["nginx"]'
LABEL "com.datadoghq.ad.init_configs"='[{}]'
LABEL "com.datadoghq.ad.instances"='[{"nginx_status_url": "http://%%host%%:81/nginx_status/"}]'

참고: 이 인스턴스 설정은 NGINX 오픈 소스에서만 작동합니다. NGINX Plus를 사용하는 경우 해당 인스턴스 설정을 인라인으로 연결하세요.

로그 수집

기본적으로 로그 수집은 Datadog 에이전트에서 비활성화되어 있습니다. 활성화하려면 Docker 로그 수집을 참고하세요.

그런 다음 Docker 레이블로 로그 통합을 설정하세요.

LABEL "com.datadoghq.ad.logs"='[{"source":"nginx","service":"nginx"}]'

쿠버네티스(Kubernetes)

쿠버네티스에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

메트릭을 수집하려면 다음 파라미터와 값을 자동탐지 템플릿에 설정합니다. NGINX 포드의 쿠버네티스 어노테이션(아래 표시) 또는 로컬 파일, ConfigMap, 키-값 저장소, Datadog Operator 매니페스트 또는 헬름(Helm) 차트를 통해 이를 수행할 수 있습니다.

파라미터
<INTEGRATION_NAME>["nginx"]
<INIT_CONFIG>[{}]
<INSTANCE_CONFIG>[{"nginx_status_url": "http://%%host%%:18080/nginx_status"}]

주석 v1(Datadog 에이전트 v7.36 이하용)

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    ad.datadoghq.com/nginx.check_names: '["nginx"]'
    ad.datadoghq.com/nginx.init_configs: '[{}]'
    ad.datadoghq.com/nginx.instances: |
      [
        {
          "nginx_status_url":"http://%%host%%:81/nginx_status/"
        }
      ]      
  labels:
    name: nginx

주석 v2(Datadog 에이전트 v7.36 이상용)

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    ad.datadoghq.com/nginx.checks: |
      {
        "nginx": {
          "init_config": {},
          "instances": [
            {
              "nginx_status_url":"http://%%host%%:81/nginx_status/"
            }
          ]
        }
      }      
  labels:
    name: nginx

참고: 이 인스턴스 설정은 NGINX 오픈 소스에서만 작동합니다. NGINX Plus를 사용하는 경우 해당 인스턴스 설정을 인라인으로 연결하세요.

로그 수집

Datadog 에이전트에서 기본적으로 로그 수집이 비활성화되어 있습니다. 활성화하려면 [쿠버네티스 로그 수집]을 확인하세요.

그런 다음 자동탐지 템플릿에서 다음을 파라미터를 설정합니다. Redis 포드에서 쿠버네티스(Kubernetes) 어노테이션(아래 표시)을 사용하거나 로컬 파일, ConfigMap, 키-값 저장소, Datadog Operator 매니페스트 또는 헬름(Helm) 차트를 사용하여 이 작업을 수행할 수 있습니다.

파라미터
<LOG_CONFIG>[{"source":"nginx","service":"nginx"}]

주석 v1/v2

apiVersion: v1
kind: Pod
metadata:
  name: nginx
  annotations:
    ad.datadoghq.com/nginx.logs: '[{"source":"nginx","service":"nginx"}]'
  labels:
    name: nginx

ECS

ECS에서 실행 중인 에이전트에 이 점검을 구성하는 방법:

메트릭 수집

애플리케이션 컨테이너에 자동탐지 통합 템플릿을 Docker 레이블로 설정하세요.

{
  "containerDefinitions": [{
    "name": "nginx",
    "image": "nginx:latest",
    "dockerLabels": {
      "com.datadoghq.ad.check_names": "[\"nginx\"]",
      "com.datadoghq.ad.init_configs": "[{}]",
      "com.datadoghq.ad.instances": "[{\"nginx_status_url\":\"http://%%host%%:81/nginx_status/\"}]"
    }
  }]
}

참고: 이 인스턴스 설정은 NGINX 오픈 소스에서만 작동합니다. NGINX Plus를 사용하는 경우 해당 인스턴스 설정을 인라인으로 연결하세요.

로그 수집

기본적으로 로그 수집은 Datadog 에이전트에서 비활성화되어 있습니다. 활성화하려면 ECS 로그 수집을 참조하세요.

그런 다음 Docker 레이블로 로그 통합을 설정하세요.

{
  "containerDefinitions": [{
    "name": "nginx",
    "image": "nginx:latest",
    "dockerLabels": {
      "com.datadoghq.ad.logs": "[{\"source\":\"nginx\",\"service\":\"nginx\"}]"
    }
  }]
}

검증

에이전트 상태 하위 명령을 실행하고 점검 섹션에서 nginx를 찾습니다.

수집한 데이터

메트릭

nginx.cache.bypass.bytes
(gauge)
The total number of bytes read from the proxied server
Shown as byte
nginx.cache.bypass.bytes_count
(count)
The total number of bytes read from the proxied server (shown as count)
Shown as byte
nginx.cache.bypass.bytes_written
(gauge)
The total number of bytes written to the cache
Shown as byte
nginx.cache.bypass.bytes_written_count
(count)
The total number of bytes written to the cache (shown as count)
Shown as byte
nginx.cache.bypass.responses
(gauge)
The total number of responses not taken from the cache
Shown as response
nginx.cache.bypass.responses_count
(count)
The total number of responses not taken from the cache (shown as count)
Shown as response
nginx.cache.bypass.responses_written
(gauge)
The total number of responses written to the cache
Shown as response
nginx.cache.bypass.responses_written_count
(count)
The total number of responses written to the cache (shown as count)
Shown as response
nginx.cache.cold
(gauge)
A boolean value indicating whether the cache loader process is still loading data from disk into the cache
Shown as response
nginx.cache.expired.bytes
(gauge)
The total number of bytes read from the proxied server
Shown as byte
nginx.cache.expired.bytes_count
(count)
The total number of bytes read from the proxied server (shown as count)
Shown as byte
nginx.cache.expired.bytes_written
(gauge)
The total number of bytes written to the cache
Shown as byte
nginx.cache.expired.bytes_written_count
(count)
The total number of bytes written to the cache (shown as count)
Shown as byte
nginx.cache.expired.responses
(gauge)
The total number of responses not taken from the cache
Shown as response
nginx.cache.expired.responses_count
(count)
The total number of responses not taken from the cache (shown as count)
Shown as response
nginx.cache.expired.responses_written
(gauge)
The total number of responses written to the cache
Shown as response
nginx.cache.expired.responses_written_count
(count)
The total number of responses written to the cache (shown as count)
Shown as response
nginx.cache.hit.bytes
(gauge)
The total number of bytes read from the cache
Shown as byte
nginx.cache.hit.bytes_count
(count)
The total number of bytes read from the cache (shown as count)
Shown as byte
nginx.cache.hit.responses
(gauge)
The total number of responses read from the cache
Shown as response
nginx.cache.hit.responses_count
(count)
The total number of responses read from the cache (shown as count)
Shown as response
nginx.cache.max_size
(gauge)
The limit on the maximum size of the cache specified in the configuration
Shown as byte
nginx.cache.miss.bytes
(gauge)
The total number of bytes read from the proxied server
Shown as byte
nginx.cache.miss.bytes_count
(count)
The total number of bytes read from the proxied server (shown as count)
Shown as byte
nginx.cache.miss.bytes_written
(gauge)
The total number of bytes written to the cache
Shown as byte
nginx.cache.miss.bytes_written_count
(count)
The total number of bytes written to the cache (shown as count)
Shown as byte
nginx.cache.miss.responses
(gauge)
The total number of responses not taken from the cache
Shown as response
nginx.cache.miss.responses_count
(count)
The total number of responses not taken from the cache (shown as count)
Shown as response
nginx.cache.miss.responses_written
(gauge)
The total number of responses written to the cache
Shown as response
nginx.cache.miss.responses_written_count
(count)
The total number of responses written to the cache
Shown as response
nginx.cache.revalidated.bytes
(gauge)
The total number of bytes read from the cache
Shown as byte
nginx.cache.revalidated.bytes_count
(count)
The total number of bytes read from the cache (shown as count)
Shown as byte
nginx.cache.revalidated.responses
(gauge)
The total number of responses read from the cache
Shown as response
nginx.cache.revalidated.responses_count
(count)
The total number of responses read from the cache (shown as count)
Shown as response
nginx.cache.size
(gauge)
The current size of the cache
Shown as response
nginx.cache.stale.bytes
(gauge)
The total number of bytes read from the cache
Shown as byte
nginx.cache.stale.bytes_count
(count)
The total number of bytes read from the cache (shown as count)
Shown as byte
nginx.cache.stale.responses
(gauge)
The total number of responses read from the cache
Shown as response
nginx.cache.stale.responses_count
(count)
The total number of responses read from the cache (shown as count)
Shown as response
nginx.cache.updating.bytes
(gauge)
The total number of bytes read from the cache
Shown as byte
nginx.cache.updating.bytes_count
(count)
The total number of bytes read from the cache (shown as count)
Shown as byte
nginx.cache.updating.responses
(gauge)
The total number of responses read from the cache
Shown as response
nginx.cache.updating.responses_count
(count)
The total number of responses read from the cache (shown as count)
Shown as response
nginx.connections.accepted
(gauge)
The total number of accepted client connections.
Shown as connection
nginx.connections.accepted_count
(count)
The total number of accepted client connections (shown as count).
Shown as connection
nginx.connections.active
(gauge)
The current number of active client connections.
Shown as connection
nginx.connections.dropped
(gauge)
The total number of dropped client connections.
Shown as connection
nginx.connections.dropped_count
(count)
The total number of dropped client connections (shown as count).
Shown as connection
nginx.connections.idle
(gauge)
The current number of idle client connections.
Shown as connection
nginx.generation
(gauge)
The total number of configuration reloads
Shown as refresh
nginx.generation_count
(count)
The total number of configuration reloads (shown as count)
Shown as refresh
nginx.limit_conn.passed
(count)
The total number of connections that were neither limited nor accounted as limited.
Shown as connection
nginx.limit_conn.rejected
(count)
The total number of connections that were rejected.
Shown as connection
nginx.limit_conn.rejected_dry_run
(count)
The total number of connections accounted as rejected in the dry run mode.
Shown as connection
nginx.limit_req.delayed
(count)
The total number of requests that were delayed.
Shown as request
nginx.limit_req.delayed_dry_run
(count)
The total number of requests accounted as delayed in the dry run mode.
Shown as request
nginx.limit_req.passed
(count)
The total number of requests that were neither limited nor accounted as limited.
Shown as request
nginx.limit_req.rejected
(count)
The total number of requests that were rejected.
Shown as request
nginx.limit_req.rejected_dry_run
(count)
The total number of requests accounted as rejected in the dry run mode.
Shown as request
nginx.load_timestamp
(gauge)
Time of the last reload of configuration (time since Epoch).
Shown as millisecond
nginx.location_zone.discarded
(count)
The total number of requests completed without sending a response.
Shown as request
nginx.location_zone.received
(count)
The total number of bytes received from clients.
Shown as byte
nginx.location_zone.requests
(count)
The total number of client requests received from clients.
Shown as request
nginx.location_zone.responses.1xx
(count)
The total number of responses with 1xx status codes.
Shown as response
nginx.location_zone.responses.2xx
(count)
The total number of responses with 2xx status codes.
Shown as response
nginx.location_zone.responses.3xx
(count)
The total number of responses with 3xx status codes.
Shown as response
nginx.location_zone.responses.4xx
(count)
The total number of responses with 4xx status codes.
Shown as response
nginx.location_zone.responses.5xx
(count)
The total number of responses with 5xx status codes.
Shown as response
nginx.location_zone.responses.code
(count)
The total number of responses per each status code.
Shown as response
nginx.location_zone.responses.total
(count)
The total number of responses sent to clients.
Shown as response
nginx.location_zone.sent
(count)
The total number of bytes sent to clients.
Shown as byte
nginx.net.conn_dropped_per_s
(rate)
Rate of connections dropped.
Shown as connection
nginx.net.conn_opened_per_s
(rate)
Rate of connections opened.
Shown as connection
nginx.net.connections
(gauge)
The total number of active connections.
Shown as connection
nginx.net.reading
(gauge)
The number of connections reading client requests.
Shown as connection
nginx.net.request_per_s
(rate)
Rate of requests processed. Measures both successful and failed requests.
Shown as request
nginx.net.waiting
(gauge)
The number of keep-alive connections waiting for work.
Shown as connection
nginx.net.writing
(gauge)
The number of connections waiting on upstream responses and/or writing responses back to the client.
Shown as connection
nginx.pid
(gauge)
The ID of the worker process that handled status request.
nginx.ppid
(gauge)
The ID of the master process that started the worker process
nginx.processes.respawned
(gauge)
The total number of abnormally terminated and respawned child processes.
Shown as process
nginx.processes.respawned_count
(count)
The total number of abnormally terminated and respawned child processes (shown as count).
Shown as process
nginx.requests.current
(gauge)
The current number of client requests.
Shown as request
nginx.requests.total
(gauge)
The total number of client requests.
Shown as request
nginx.requests.total_count
(count)
The total number of client requests (shown as count).
Shown as request
nginx.resolver.requests.addr
(count)
The total number of requests to resolve addresses to names.
Shown as request
nginx.resolver.requests.name
(count)
The total number of requests to resolve names to addresses.
Shown as request
nginx.resolver.requests.srv
(count)
The total number of requests to resolve SRV records.
Shown as request
nginx.resolver.responses.formerr
(count)
The total number of FORMERR (Format error) responses.
Shown as response
nginx.resolver.responses.noerror
(count)
The total number of successful responses.
Shown as response
nginx.resolver.responses.notimp
(count)
The total number of NOTIMP (Unimplemented) responses.
Shown as response
nginx.resolver.responses.nxdomain
(count)
The total number of NXDOMAIN (Host not found) responses.
Shown as response
nginx.resolver.responses.refused
(count)
The total number of REFUSED (Operation refused) responses.
Shown as response
nginx.resolver.responses.servfail
(count)
The total number of SERVFAIL (Server failure) responses.
Shown as response
nginx.resolver.responses.timedout
(count)
The total number of timed out requests.
Shown as request
nginx.resolver.responses.unknown
(count)
The total number of requests completed with an unknown error.
Shown as request
nginx.server_zone.discarded
(gauge)
The total number of requests completed without sending a response.
Shown as request
nginx.server_zone.discarded_count
(count)
The total number of requests completed without sending a response (shown as count).
Shown as request
nginx.server_zone.processing
(gauge)
The number of client requests that are currently being processed.
Shown as request
nginx.server_zone.received
(gauge)
The total amount of data received from clients.
Shown as byte
nginx.server_zone.received_count
(count)
The total amount of data received from clients (shown as count).
Shown as byte
nginx.server_zone.requests
(gauge)
The total number of client requests received from clients.
Shown as request
nginx.server_zone.requests_count
(count)
The total number of client requests received from clients (shown as count).
Shown as request
nginx.server_zone.responses.1xx
(gauge)
The number of responses with 1xx status code.
Shown as response
nginx.server_zone.responses.1xx_count
(count)
The number of responses with 1xx status code (shown as count).
Shown as response
nginx.server_zone.responses.2xx
(gauge)
The number of responses with 2xx status code.
Shown as response
nginx.server_zone.responses.2xx_count
(count)
The number of responses with 2xx status code (shown as count).
Shown as response
nginx.server_zone.responses.3xx
(gauge)
The number of responses with 3xx status code.
Shown as response
nginx.server_zone.responses.3xx_count
(count)
The number of responses with 3xx status code (shown as count).
Shown as response
nginx.server_zone.responses.4xx
(gauge)
The number of responses with 4xx status code.
Shown as response
nginx.server_zone.responses.4xx_count
(count)
The number of responses with 4xx status code (shown as count).
Shown as response
nginx.server_zone.responses.5xx
(gauge)
The number of responses with 5xx status code.
Shown as response
nginx.server_zone.responses.5xx_count
(count)
The number of responses with 5xx status code (shown as count).
Shown as response
nginx.server_zone.responses.code
(count)
The total number of responses per each status code, tagged with status code number.
Shown as response
nginx.server_zone.responses.total
(gauge)
The total number of responses sent to clients.
Shown as response
nginx.server_zone.responses.total_count
(count)
The total number of responses sent to clients (shown as count).
Shown as response
nginx.server_zone.sent
(gauge)
The total amount of data sent to clients.
Shown as byte
nginx.server_zone.sent_count
(count)
The total amount of data sent to clients (shown as count).
Shown as byte
nginx.slab.pages.free
(gauge)
The current number of free memory pages
Shown as page
nginx.slab.pages.used
(gauge)
The current number of used memory pages
Shown as page
nginx.slab.slot.fails
(gauge)
The number of unsuccessful attempts to allocate memory of specified size
Shown as request
nginx.slab.slot.fails_count
(count)
The number of unsuccessful attempts to allocate memory of specified size (shown as count)
Shown as request
nginx.slab.slot.free
(gauge)
The current number of free memory slots
nginx.slab.slot.reqs
(gauge)
The total number of attempts to allocate memory of specified size
Shown as request
nginx.slab.slot.reqs_count
(count)
The total number of attempts to allocate memory of specified size (shown as count)
Shown as request
nginx.slab.slot.used
(gauge)
The current number of used memory slots
nginx.ssl.handshakes
(gauge)
The total number of successful SSL handshakes.
nginx.ssl.handshakes_count
(count)
The total number of successful SSL handshakes (shown as count).
nginx.ssl.handshakes_failed
(gauge)
The total number of failed SSL handshakes.
nginx.ssl.handshakes_failed_count
(count)
The total number of failed SSL handshakes (shown as count).
nginx.ssl.session_reuses
(gauge)
The total number of session reuses during SSL handshake.
nginx.ssl.session_reuses_count
(count)
The total number of session reuses during SSL handshake (shown as count).
nginx.stream.limit_conn.passed
(count)
The total number of connections that were neither limited nor accounted as limited.
Shown as connection
nginx.stream.limit_conn.rejected
(count)
The total number of connections that were rejected.
Shown as connection
nginx.stream.limit_conn.rejected_dry_run
(count)
The total number of connections accounted as rejected in the dry run mode.
Shown as connection
nginx.stream.server_zone.connections
(gauge)
The total number of connections accepted from clients
Shown as connection
nginx.stream.server_zone.connections_count
(count)
The total number of connections accepted from clients (shown as count)
Shown as connection
nginx.stream.server_zone.discarded
(gauge)
The total number of requests completed without sending a response.
Shown as request
nginx.stream.server_zone.discarded_count
(count)
The total number of requests completed without sending a response (shown as count).
Shown as request
nginx.stream.server_zone.processing
(gauge)
The number of client requests that are currently being processed.
Shown as request
nginx.stream.server_zone.received
(gauge)
The total amount of data received from clients.
Shown as byte
nginx.stream.server_zone.received_count
(count)
The total amount of data received from clients (shown as count).
Shown as byte
nginx.stream.server_zone.sent
(gauge)
The total amount of data sent to clients.
Shown as byte
nginx.stream.server_zone.sent_count
(count)
The total amount of data sent to clients (shown as count).
Shown as byte
nginx.stream.server_zone.sessions.2xx
(gauge)
The number of responses with 2xx status code.
Shown as session
nginx.stream.server_zone.sessions.2xx_count
(count)
The number of responses with 2xx status code (shown as count).
Shown as session
nginx.stream.server_zone.sessions.4xx
(gauge)
The number of responses with 4xx status code.
Shown as session
nginx.stream.server_zone.sessions.4xx_count
(count)
The number of responses with 4xx status code (shown as count).
Shown as session
nginx.stream.server_zone.sessions.5xx
(gauge)
The number of responses with 5xx status code.
Shown as session
nginx.stream.server_zone.sessions.5xx_count
(count)
The number of responses with 5xx status code (shown as count).
Shown as session
nginx.stream.server_zone.sessions.total
(gauge)
The total number of responses sent to clients.
Shown as session
nginx.stream.server_zone.sessions.total_count
(count)
The total number of responses sent to clients (shown as count).
Shown as session
nginx.stream.upstream.peers.active
(gauge)
The current number of connections
Shown as connection
nginx.stream.upstream.peers.backup
(gauge)
A boolean value indicating whether the server is a backup server.
nginx.stream.upstream.peers.connect_time
(gauge)
The average time to connect to this server.
Shown as millisecond
nginx.stream.upstream.peers.connections
(gauge)
The total number of client connections forwarded to this server.
Shown as connection
nginx.stream.upstream.peers.connections_count
(count)
The total number of client connections forwarded to this server (shown as count).
Shown as connection
nginx.stream.upstream.peers.downstart
(gauge)
The time (time since Epoch) when the server became "unavail" or "checking" or "unhealthy"
Shown as millisecond
nginx.stream.upstream.peers.downtime
(gauge)
Total time the server was in the "unavail" or "checking" or "unhealthy" states.
Shown as millisecond
nginx.stream.upstream.peers.downtime_count
(count)
Total time the server was in the "unavail" or "checking" or "unhealthy" states.
Shown as millisecond
nginx.stream.upstream.peers.fails
(gauge)
The total number of unsuccessful attempts to communicate with the server.
Shown as error
nginx.stream.upstream.peers.fails_count
(count)
The total number of unsuccessful attempts to communicate with the server (shown as count).
Shown as error
nginx.stream.upstream.peers.first_byte_time
(gauge)
The average time to receive the first byte of data from this server.
Shown as millisecond
nginx.stream.upstream.peers.health_checks.checks
(gauge)
The total number of health check requests made.
Shown as request
nginx.stream.upstream.peers.health_checks.checks_count
(count)
The total number of health check requests made (shown as count).
Shown as request
nginx.stream.upstream.peers.health_checks.fails
(gauge)
The number of failed health checks.
Shown as error
nginx.stream.upstream.peers.health_checks.fails_count
(count)
The number of failed health checks (shown as count).
Shown as error
nginx.stream.upstream.peers.health_checks.last_passed
(gauge)
Boolean indicating if the last health check request was successful and passed tests.
nginx.stream.upstream.peers.health_checks.unhealthy
(gauge)
How many times the server became unhealthy (state "unhealthy").
nginx.stream.upstream.peers.health_checks.unhealthy_count
(count)
How many times the server became unhealthy (state "unhealthy") (shown as count).
nginx.stream.upstream.peers.id
(gauge)
The ID of the server.
nginx.stream.upstream.peers.max_conns
(gauge)
The max_conns limit for the server.
Shown as connection
nginx.stream.upstream.peers.received
(gauge)
The total number of bytes received from this server.
Shown as byte
nginx.stream.upstream.peers.received_count
(count)
The total number of bytes received from this server (shown as count).
Shown as byte
nginx.stream.upstream.peers.response_time
(gauge)
The average time to receive the last byte of data from this server.
Shown as millisecond
nginx.stream.upstream.peers.response_time_histogram
(gauge)
The average time to receive the last byte of data from this server as a histogram.
Shown as millisecond
nginx.stream.upstream.peers.response_time_histogram.avg
(gauge)

Shown as millisecond
nginx.stream.upstream.peers.response_time_histogram.count
(rate)

Shown as millisecond
nginx.stream.upstream.peers.response_time_histogram.max
(gauge)

Shown as millisecond
nginx.stream.upstream.peers.response_time_histogram.median
(gauge)

Shown as millisecond
nginx.stream.upstream.peers.selected
(gauge)
The time (time since Epoch) when the server was last selected to process a connection.
Shown as millisecond
nginx.stream.upstream.peers.sent
(gauge)
The total number of bytes sent to this server.
Shown as byte
nginx.stream.upstream.peers.sent_count
(count)
The total number of bytes sent to this server (shown as count).
Shown as byte
nginx.stream.upstream.peers.unavail
(gauge)
How many times the server became unavailable for client connections (state "unavail").
nginx.stream.upstream.peers.unavail_count
(count)
How many times the server became unavailable for client connections (state "unavail") (shown as count).
nginx.stream.upstream.peers.weight
(gauge)
Weight of the server.
nginx.stream.upstream.zombies
(gauge)
The current number of servers removed from the group but still processing active client connections.
Shown as host
nginx.stream.zone_sync.status.bytes_in
(gauge)
The number of bytes received by this node.
Shown as byte
nginx.stream.zone_sync.status.bytes_out
(gauge)
The number of bytes sent by this node.
Shown as byte
nginx.stream.zone_sync.status.msgs_in
(gauge)
The number of messages received by this node.
Shown as message
nginx.stream.zone_sync.status.msgs_out
(gauge)
The number of messages sent by this node.
Shown as message
nginx.stream.zone_sync.status.nodes_online
(gauge)
The number of peers this node is connected to.
nginx.stream.zone_sync.zone.records_pending
(gauge)
The number of records that need to be sent to the cluster.
Shown as record
nginx.stream.zone_sync.zone.records_total
(gauge)
The number of records stored in the shared memory zone.
Shown as record
nginx.stream.zone_sync.zone.records_total_count
(count)
The total number of records stored in the shared memory zone.
Shown as record
nginx.timestamp
(gauge)
Current time since Epoch.
Shown as millisecond
nginx.upstream.keepalive
(gauge)
The current number of idle keepalive connections.
Shown as connection
nginx.upstream.peers.active
(gauge)
The current number of active connections.
Shown as connection
nginx.upstream.peers.backup
(gauge)
A boolean value indicating whether the server is a backup server.
nginx.upstream.peers.downstart
(gauge)
The time (since Epoch) when the server became "unavail" or "unhealthy".
Shown as millisecond
nginx.upstream.peers.downtime
(gauge)
Total time the server was in the "unavail" and "unhealthy" states.
Shown as millisecond
nginx.upstream.peers.downtime_count
(count)
Total time the server was in the "unavail" and "unhealthy" states.
Shown as millisecond
nginx.upstream.peers.fails
(gauge)
The total number of unsuccessful attempts to communicate with the server.
nginx.upstream.peers.fails_count
(count)
The total number of unsuccessful attempts to communicate with the server (shown as count).
nginx.upstream.peers.header_time
(gauge)
The total amount of time spent on receiving the response header from the upstream server.
Shown as millisecond
nginx.upstream.peers.health_checks.checks
(gauge)
The total number of health check requests made.
nginx.upstream.peers.health_checks.checks_count
(count)
The total number of health check requests made (shown as count).
nginx.upstream.peers.health_checks.fails
(gauge)
The number of failed health checks.
nginx.upstream.peers.health_checks.fails_count
(count)
The number of failed health checks (shown as count).
nginx.upstream.peers.health_checks.last_passed
(gauge)
Boolean indicating if the last health check request was successful and passed tests.
nginx.upstream.peers.health_checks.unhealthy
(gauge)
How many times the server became unhealthy (state "unhealthy").
nginx.upstream.peers.health_checks.unhealthy_count
(count)
How many times the server became unhealthy (state "unhealthy") (shown as count).
nginx.upstream.peers.id
(gauge)
The ID of the server.
nginx.upstream.peers.max_conns
(gauge)
The max_conns limit for this server.
Shown as connection
nginx.upstream.peers.received
(gauge)
The total amount of data received from this server.
Shown as byte
nginx.upstream.peers.received_count
(count)
The total amount of data received from this server (shown as count).
Shown as byte
nginx.upstream.peers.requests
(gauge)
The total number of client requests forwarded to this server.
Shown as request
nginx.upstream.peers.requests_count
(count)
The total number of client requests forwarded to this server (shown as count).
Shown as request
nginx.upstream.peers.response_time
(gauge)
The average time to receive the last byte of data from this server.
Shown as millisecond
nginx.upstream.peers.response_time_histogram
(gauge)
The average time to receive the last byte of data from this server as a histogram.
Shown as millisecond
nginx.upstream.peers.response_time_histogram.avg
(gauge)

Shown as millisecond
nginx.upstream.peers.response_time_histogram.count
(rate)

Shown as millisecond
nginx.upstream.peers.response_time_histogram.max
(gauge)

Shown as millisecond
nginx.upstream.peers.response_time_histogram.median
(gauge)

Shown as millisecond
nginx.upstream.peers.responses.1xx
(gauge)
The number of responses with 1xx status code from this server.
Shown as response
nginx.upstream.peers.responses.1xx_count
(count)
The number of responses with 1xx status code (shown as count) from this server.
Shown as response
nginx.upstream.peers.responses.2xx
(gauge)
The number of responses with 2xx status code from this server.
Shown as response
nginx.upstream.peers.responses.2xx_count
(count)
The number of responses with 2xx status code (shown as count) from this server.
Shown as response
nginx.upstream.peers.responses.3xx
(gauge)
The number of responses with 3xx status code from this server.
Shown as response
nginx.upstream.peers.responses.3xx_count
(count)
The number of responses with 3xx status code (shown as count) from this server.
Shown as response
nginx.upstream.peers.responses.4xx
(gauge)
The number of responses with 4xx status code from this server.
Shown as response
nginx.upstream.peers.responses.4xx_count
(count)
The number of responses with 4xx status code (shown as count) from this server.
Shown as response
nginx.upstream.peers.responses.5xx
(gauge)
The number of responses with 5xx status code from this server.
Shown as response
nginx.upstream.peers.responses.5xx_count
(count)
The number of responses with 5xx status code (shown as count).
Shown as response
nginx.upstream.peers.responses.code
(count)
The total number of responses from this server per each status code.
Shown as response
nginx.upstream.peers.responses.total
(gauge)
The total number of responses obtained from this server.
Shown as response
nginx.upstream.peers.responses.total_count
(count)
The total number of responses obtained from this server (shown as count).
Shown as response
nginx.upstream.peers.selected
(gauge)
The time (since Epoch) when the server was last selected to process a request (1.7.5).
Shown as millisecond
nginx.upstream.peers.sent
(gauge)
The total amount of data sent to this server.
Shown as byte
nginx.upstream.peers.sent_count
(count)
The total amount of data sent to this server (shown as count).
Shown as byte
nginx.upstream.peers.unavail
(gauge)
How many times the server became unavailable for client requests (state "unavail") due to the number of unsuccessful attempts reaching the max_fails threshold.
nginx.upstream.peers.unavail_count
(count)
How many times the server became unavailable for client requests (state "unavail") due to the number of unsuccessful attempts reaching the max_fails threshold (shown as count).
nginx.upstream.peers.weight
(gauge)
Weight of the server.
nginx.upstream.zombies
(gauge)
The current number of servers removed from the group but still processing active client connections.
Shown as host
nginx.version
(gauge)
Version of nginx.

표시된 메트릭이 모두 오픈 소스 NGINX 사용자가 사용할 수 있는 것은 아닙니다. 스텁 상태(오픈 소스 NGINX)와 http 상태(NGINX Plus)의 모듈 참조를 비교하여 각 모듈에서 어떤 메트릭을 제공하는지 파악하세요.

몇 가지 오픈 소스 NGINX 메트릭은 NGINX Plus에서 이름이 다르지만 메트릭이 동일합니다.

NGINXNGINX Plus
nginx.net.connectionsnginx.connections.active
nginx.net.conn_opened_per_snginx.connections.accepted
nginx.net.conn_dropped_per_snginx.connections.dropped
nginx.net.request_per_snginx.requests.total

이들 메트릭이 정확히 같은 메트릭을 가리키지는 않지만 어느 정도 관련이 있습니다.

NGINXNGINX Plus
nginx.net.waitingnginx.connections.idle

마지막으로, 이들 메트릭과 동등한 메트릭이 없습니다.

메트릭설명
nginx.net.readingnginx가 요청 헤더를 읽고 있는 현재 연결 수입니다.
nginx.net.writingnginx가 클라이언트에 응답을 다시 쓰고 있는 현재 연결 수입니다.

이벤트

NGINX 점검에는 이벤트가 포함되어 있지 않습니다.

서비스 점검

nginx.can_connect
Returns CRITICAL if the Agent is unable to connect to and collect metrics from the monitored Nginx instance. Returns OK otherwise.
Statuses: ok, critical

트러블슈팅

  • [로그에 예상 타임스탬프가 없는 이유는 무엇인가요?]]6

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

참고 자료

기타 유용한 문서, 링크 및 기사: