Getting started
  • Updated on 18 Apr 2019
  • 1 minute to read
  • Contributors
  • Print
  • Share
  • Dark
    Light

Getting started

  • Print
  • Share
  • Dark
    Light

Retrace offers many basic and advanced features. In this article we will try to outline all of the amazing things that Retrace can do for your Python application.

Step 1. Install Retrace


The first thing you need to do is install the Retrace monitoring agent on your server.

Linux Only Currently
Currently, only Python on Linux is supported. Windows support is planned for a future release.

Step 2. Add Stackify APM Module


Django

  1. Check that your setup meets our system requirements.

    • Python Versions (2.7 - 3.7)
    • Django Versions (1.7 - 2)
  2. Install the Stackify Python APM agent using pip:

    $ pip install stackify-python-apm
    

    You may install your stackify-python-apm by adding it to your project's requirements.txt file.

  3. Add stackifyapm.contrib.django to INSTALLED_APPS in your settings.py:

    INSTALLED_APPS = ( # ... 'stackifyapm.contrib.django', )
    
  4. Add our tracing middleware to MIDDLEWARE in your settings.py:

    MIDDLEWARE = ( 'stackifyapm.contrib.django.middleware.TracingMiddleware', # ... )
    
  5. Customize Application Name and Environment configuration in your settings.py:

    APPLICATION_NAME = 'Python Application'
    ENVIRONMENT = 'Production'
    

Flask

  1. Check that your setup meets our system requirements.

    • Python Versions (2.7 - 3.7)
    • Flask Versions (0.7 - 1.0)
  2. Install the Stackify Python APM agent using pip:

    $ pip install stackify-python-apm
    

    You may install your stackify-python-apm by adding it to your project's requirements.txt file.

  3. Update and insert the apm settings to your application:

    from stackifyapm.contrib.flask import StackifyAPM
    
    app = Flask(...)
    StackifyAPM(app)
    
  4. Customize Application Name and Environment configuration:

    app.config['APPLICATION_NAME'] = 'Python Application'
    app.config['ENVIRONMENT'] = 'Production'
    
    StackifyAPM(app)
    

Pyramid

  1. Check that your setup meets our system requirements.

    • Python Versions (2.7 - 3.7)
    • Pyramid Versions (1.4 - 1.10)
  2. Install the Stackify Python APM agent using pip:

    $ pip install stackify-python-apm
    

    You may install your stackify-python-apm by adding it to your project's requirements.txt file.

  3. Update and insert the apm settings to your application:
    Include our pyramid tween integration:

    with Configurator() as config:
    config.include('stackifyapm.contrib.pyramid')
    

    Or explicit tween configuration:

    with Configurator({
        'pyramid.tweens': ['stackifyapm.contrib.pyramid.stackifyapm_tween_factory'].
    }) as config:
        ...
    
  4. Customize Application Name and Environment configuration:

    with Configurator({
        'APPLICATION_NAME': 'Python Application',
        'ENVIRONMENT': 'Production',
    }) as config:
        config.include('stackifyapm.contrib.pyramid')
    

Build and Deploy your application.

Was this article helpful?