New Relic メモ 〜Apache Integration〜
やりたいこと
- New Relic InfrastructureのThird-Party IntegrationからApacheを追加したい
- デフォルトで取れるメトリクスを確認したい
参考ドキュメント
- New Relicが公開しているApache Integrationを基に作業する
事前準備
- 以前作ったCentOS+Node.js+MySQLの環境の前段にApacheを配置する
- ApacheはHTTPS(443)をListenし、Express.js(3000)にプロキシさせる
Client -443-> Apache -3000-> Express.js + MySQL
Apacheは以下の設定をconf.dに突っ込んでおく
/server-status
の除外設定は後述。
proxy.conf
SSLProxyEngine on
RewriteCond %{REQUEST_URI} !=/server-status
RewriteRule ^/(.*) http://localhost:3000/$1 [P,L]
前提条件確認
Apache Integrationの有効化には以下の条件がある模様
- Apache 2.2か2.4であること
- 今回は2.4を使う
- mod_status.soがLoadModuleされていて、
/server-status
のエンドポイントをローカルから叩けること- デフォルトでLoadModuleされている
- また、以下の設定をconf.dに突っ込んでおく
status.conf
<Location /server-status>
SetHandler server-status
Require host localhost
</Location>
ExtendedStatus On
Apache有効化手順
nri-apache
モジュールをインストールする。
# yum install nri-apache
設定ファイルのディレクトリに移動し、ファイル名を変更する。
# cd /etc/newrelic-infra/integrations.d
# cp apache-config.yml.sample apache-config.yml
ファイルの中身は以下の通り。変更する場合はこちらを参照のこと。
apache-config.yml
integration_name: com.newrelic.apache
instances:
- name: apache-server-metrics
command: metrics
arguments:
status_url: http://127.0.0.1/server-status?auto
remote_monitoring: true
labels:
env: production
role: load_balancer
- name: apache-server-inventory
command: inventory
arguments:
remote_monitoring: true
labels:
env: production
role: load_balancer
newrelic-infraを再起動する。
# systemctl restart newrelic-infra
動作確認
InfrastructureからThird-party Servicesに行くと、Apacheが追加されている。
中を覗くと、ダッシュボードみたいなのが表示されている。
この後確認したいこと
- パスごとのアクセス分析ができるか
- 並列に複数台並べた時に横串でアクセス分析ができるか
このへんはNRQLで対応するのかな?
Author And Source
この問題について(New Relic メモ 〜Apache Integration〜), 我々は、より多くの情報をここで見つけました https://qiita.com/1ksen/items/048068b1b0c43dfb9f0c著者帰属:元の著者の情報は、元のURLに含まれています。著作権は原作者に属する。
Content is automatically searched and collected through network algorithms . If there is a violation . Please contact us . We will adjust (correct author information ,or delete content ) as soon as possible .