※画像と内容は一切関係ありません
DatadogのApacheインテグレーション設定を試してみます。
と言っても下記ページ通りで簡単に取得できます。留意点としてはExtendedStatusの有効化をすること位かと思います。
取得できるメトリクスは以下になります。
apache.net.bytes apache.net.bytes_per_s apache.net.hits apache.net.request_per_s apache.performance.busy_workers apache.performance.cpu_load apache.performance.idle_workers apache.performance.uptime
Apache mod_status 有効化
CentOS 6.7 でrpmからインストールした場合、モジュールは既に導入済みとなっています。
$ apachectl -V Server version: Apache/2.2.15 (Unix) $ apachectl -M ・・・略・・・ status_module (shared) ・・・略・・・
設定ファイルを変更します。ローカルホストからのみアクセスを受け付けるよう設定しています。
$ sudo vi /etc/httpd/conf/httpd.conf ・・・略・・・ # mod_statusモジュール読み込み LoadModule status_module modules/mod_status.so ・・・略・・・ # ExtendedStatus有効化(コメントアウトを外す) ExtendedStatus On ・・・略・・・ # server-status有効化(コメントアウトを外し、許可IPの設定) <Location /server-status> SetHandler server-status Order deny,allow Deny from all Allow from 127.0.0.1 </Location> ・・・略・・・ # Apache再起動 $ sudo service httpd restart # server-status確認 $ curl http://localhost/server-status <html><head> <title>Apache Status</title> </head><body> <h1>Apache Server Status for localhost</h1> <dl><dt>Server Version: Apache/2.2.15 (Unix) DAV/2 PHP/5.6.13</dt> <dt>Server Built: Aug 24 2015 17:52:49 ・・・略・・・
DatadogAgent Apacheインテグレーション有効化
DatadogAgentは既に導入済みの前提です。exampleファイルそのままの内容を使用します。(タグ付け等はお好みで)
# exampleファイルコピー $ sudo cp -p /etc/dd-agent/conf.d/apache.yaml.example /etc/dd-agent/conf.d/apache.yaml $ sudo cat /etc/dd-agent/conf.d/apache.yaml init_config: instances: - apache_status_url: http://localhost/server-status?auto # apache_user: example_user # apache_password: example_password # tags: # - optional_tag # DatadogAgent再起動 $ sudo service datadog-agent restart
DatadogAgent再起動後にinfoで確認し、以下の様な出力があれば有効化されています。
# ApacheIntegration有効化確認 $ sudo service datadog-agent info ・・・略・・・ apache ------ - instance #0 [OK] - Collected 8 metrics, 0 events & 2 service checks ・・・略・・・
Datadogメトリクス確認
Datadog上でメトリクスが取得できていることが確認できます。
- Add Graph