Python agent and Tornado 3

The New Relic Python agent can automatically instrument the Tornado 3 web server. The agent instruments the entry point for web requests, whether you use the Tornado async interface or the WSGI container. You can initialize the agent automatically by calling the newrelic-admin wrapper script, or manually with the agent API.

For Tornado 4, see Introductory Tornado 4 support.

Automatic initialization with wrapper script

For almost all use cases, you can automatically initialize the agent with the newrelic-admin script. You can automatically initialize the agent as long as you start your app with python app.py and use either the Tornado async interface or the Tornado WSGIContainer.

To automatically initialize the agent, run:

NEW_RELIC_CONFIG_FILE=path/to/newrelic.ini newrelic-admin run-python app.py

Manual initialization with agent API

For Tornado 3, you should almost always initialize the agent automatically with the wrapper script. However, if you can't use the script, you can manually initialize the agent by calling the agent API when your web application starts. Call the agent early in your app startup, after any module import paths, but before importing the Tornado web server, separate app modules, or module frameworks.

For detailed instructions, see integration with your Python application.

For more help

Additional documentation resources include:

Join the discussion about Python in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.