Supported OS Linux Windows Mac OS

インテグレーションバージョン4.5.0

Apache ダッシュボード

概要

Apache チェックは、毎秒のリクエスト数、処理されたバイト数、ワーカースレッド数、サービスアップタイムなどを追跡します。

計画と使用

インフラストラクチャーリスト

Apache チェックは Datadog Agent にパッケージ化されています。Apache のメトリクスとログの収集を開始するには、以下を行います。

  1. Apache サーバーに Agent をインストールします。

  2. Apache サーバーに mod_status をインストールし、ExtendedStatus を有効にします。

ブラウザトラブルシューティング

メトリクスベース SLO

ホストで実行中の Agent に対してこのチェックを構成するには

メトリクスの収集
  1. Apache メトリクスの収集を開始するには、Agent のコンフィギュレーションディレクトリのルートにある conf.d/ フォルダーの apache.d/conf.yaml ファイルを編集します。使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル apache.d/conf.yaml を参照してください。

    init_config:
    
    instances:
      ## @param apache_status_url - string - required
      ## Status url of your Apache server.
      #
      - apache_status_url: http://localhost/server-status?auto
    
  2. Agent を再起動します

収集データ

Agent バージョン 6.0 以降で利用可能

  1. Datadog Agent で、ログの収集はデフォルトで無効になっています。datadog.yaml で有効にします。

    logs_enabled: true
    
  2. このコンフィギュレーションブロックを apache.d/conf.yaml ファイルに追加して、Apache ログの収集を開始します。このとき、お使いの環境に応じて構成するために pathservice の値が調整されます。

    logs:
      - type: file
        path: /path/to/your/apache/access.log
        source: apache
        service: apache
        sourcecategory: http_web_access
    
      - type: file
        path: /path/to/your/apache/error.log
        source: apache
        service: apache
        sourcecategory: http_web_error
    

    使用可能なすべてのコンフィギュレーションオプションの詳細については、サンプル apache.d/conf.yaml を参照してください。

  3. Agent を再起動します

Docker

コンテナで実行中の Agent に対してこのチェックを構成するには:

メトリクスの収集

アプリケーションのコンテナで、オートディスカバリーのインテグレーションテンプレートを Docker ラベルとして設定します。

LABEL "com.datadoghq.ad.check_names"='["apache"]'
LABEL "com.datadoghq.ad.init_configs"='[{}]'
LABEL "com.datadoghq.ad.instances"='[{"apache_status_url": "http://%%host%%/server-status?auto"}]'
収集データ

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Docker ログ収集を参照してください。

次に、ログインテグレーションを Docker ラベルとして設定します。

LABEL "com.datadoghq.ad.logs"='[{"source": "apache", "service": "<SERVICE_NAME>"}]'

ガイド

このチェックを、Kubernetes で実行している Agent に構成します。

メトリクスの収集

アプリケーションのコンテナで、オートディスカバリーのインテグレーションテンプレートをポッドアノテーションとして設定します。他にも、ファイル、ConfigMap、または key-value ストアを使用してテンプレートを構成できます。

Annotations v1 (Datadog Agent < v7.36 向け)

apiVersion: v1
kind: Pod
metadata:
  name: apache
  annotations:
    ad.datadoghq.com/apache.check_names: '["apache"]'
    ad.datadoghq.com/apache.init_configs: '[{}]'
    ad.datadoghq.com/apache.instances: |
      [
        {
          "apache_status_url": "http://%%host%%/server-status?auto"
        }
      ]      
spec:
  containers:
    - name: apache

Annotations v2 (Datadog Agent v7.36+ 向け)

apiVersion: v1
kind: Pod
metadata:
  name: apache
  annotations:
    ad.datadoghq.com/apache.checks: |
      {
        "apache": {
          "init_config": {},
          "instances": [
            {
              "apache_status_url": "http://%%host%%/server-status?auto"
            }
          ]
        }
      }      
spec:
  containers:
    - name: apache
収集データ

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、Kubernetes ログ収集を参照してください。

次に、ログのインテグレーションをポッドアノテーションとして設定します。これは、ファイル、ConfigMap、または key-value ストアを使用して構成することも可能です。

Annotations v1/v2

apiVersion: v1
kind: Pod
metadata:
  name: apache
  annotations:
    ad.datadoghq.com/apache.logs: '[{"source":"apache","service":"<SERVICE_NAME>"}]'
spec:
  containers:
    - name: apache

ECS

このチェックを、ECS で実行している Agent に構成するには:

メトリクスの収集

アプリケーションのコンテナで、オートディスカバリーのインテグレーションテンプレートを Docker ラベルとして設定します。

{
  "containerDefinitions": [{
    "name": "apache",
    "image": "apache:latest",
    "dockerLabels": {
      "com.datadoghq.ad.check_names": "[\"apache\"]",
      "com.datadoghq.ad.init_configs": "[{}]",
      "com.datadoghq.ad.instances": "[{\"apache_status_url\": \"http://%%host%%/server-status?auto\"}]"
    }
  }]
}
収集データ

Datadog Agent で、ログの収集はデフォルトで無効になっています。有効にする方法については、ECS ログ収集を参照してください。

次に、ログインテグレーションを Docker ラベルとして設定します。

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

検証

Agent の status サブコマンドを実行し、Checks セクションの apache を探します。

リアルユーザーモニタリング

データセキュリティ

apache.conns_async_closing
(gauge)
The number of asynchronous closing connections.
Shown as connection
apache.conns_async_keep_alive
(gauge)
The number of asynchronous keep alive connections.
Shown as connection
apache.conns_async_writing
(gauge)
The number of asynchronous writes connections.
Shown as connection
apache.conns_total
(gauge)
The total number of connections performed.
Shown as connection
apache.net.bytes
(gauge)
The total number of bytes served.
Shown as byte
apache.net.bytes_per_s
(gauge)
The number of bytes served per second.
Shown as byte
apache.net.hits
(gauge)
The total number of requests performed.
Shown as request
apache.net.request_per_s
(gauge)
The number of requests performed per second.
Shown as request
apache.performance.busy_workers
(gauge)
The number of workers serving requests.
Shown as thread
apache.performance.cpu_load
(gauge)
The percent of CPU used.
Shown as percent
apache.performance.idle_workers
(gauge)
The number of idle workers.
Shown as thread
apache.performance.max_workers
(gauge)
The maximum number of workers apache can start.
Shown as thread
apache.performance.uptime
(gauge)
The amount of time the server has been running.
Shown as second
apache.scoreboard.closing_connection
(gauge)
The amount of workers that are currently closing a connection.
Shown as thread
apache.scoreboard.disabled
(gauge)
These slots will never be able to handle any requests, indicates a misconfiguration.
Shown as thread
apache.scoreboard.dns_lookup
(gauge)
The workers waiting on a DNS lookup.
Shown as thread
apache.scoreboard.gracefully_finishing
(gauge)
The number of workers finishing their request.
Shown as thread
apache.scoreboard.idle_cleanup
(gauge)
These workers were idle and their process is being stopped.
Shown as thread
apache.scoreboard.keepalive
(gauge)
The workers intended for a new request from the same client, because it asked to keep the connection alive.
Shown as thread
apache.scoreboard.logging
(gauge)
The workers writing something to the Apache logs.
Shown as thread
apache.scoreboard.open_slot
(gauge)
The amount of workers that Apache can still start before hitting the maximum number of workers.
Shown as thread
apache.scoreboard.reading_request
(gauge)
The workers reading the incoming request.
Shown as thread
apache.scoreboard.sending_reply
(gauge)
The number of workers sending a reply/response or waiting on a script (like PHP) to finish so they can send a reply.
Shown as thread
apache.scoreboard.starting_up
(gauge)
The workers that are still starting up and not yet able to handle a request.
Shown as thread
apache.scoreboard.waiting_for_connection
(gauge)
The number of workers that can immediately process an incoming request.
Shown as thread

ヘルプ

Apache チェックにはイベントは含まれません。

ヘルプ

apache.can_connect
Agent が監視対象の Apache インスタンスに接続できない場合は、CRITICAL を返します。それ以外の場合は、OK を返します。
Statuses: ok, クリティカル

ヘルプ

Apache のステータス URL

Apache インテグレーションで問題が発生する場合の多くは、Agent が Apache のステータス URL にアクセスできないことが原因です。apache.d/conf.yaml ファイルに一覧表示されている apache_status_url に対して curl を実行してみてください (必要に応じてログイン資格情報を指定)。

その他の参考資料

お役に立つドキュメント、リンクや記事: