Python エージェントは flup と連携して FastCGI と一緒に使うことができます。知られている特別な要件や制限はありませんので、 Install the Python agent の一般的な統合手順に従うことができます。
アドミンスクリプトの統合例
FastCGI の場合、Web アプリケーションは常に外部プロセスとして管理されます。flupのFastCGI/WSGIアダプタを統合している場合は、以下のようになります。
#!/usr/bin/env python
import sysfrom fcgi import WSGIServer
def application(environ, start_response): status = '200 OK' output = 'Hello World!'
response_headers = [('Content-type', 'text/plain'), ('Content-Length', str(len(output)))] start_response(status, response_headers)
return [output]
ret = WSGIServer(application).run()
また、FastCGIプロセスをPythonで直接Pythonスクリプトとして起動している場合は、 python app.py
、代わりに実行します。
NEW_RELIC_CONFIG_FILE=newrelic.ini newrelic-admin run-program python app.py
インストールプロセスの詳細については、 Pythonエージェントのインストール を参照してください。