Install the Python microagent on Heroku application

Heroku's behavior change since Datadog's Sqreen acquisition

Since Sqreen has joined Datadog, signing up through Heroku, or creating new Heroku applications, is not possible anymore. Click here to learn more.

Heroku is a Platform as a Service (PaaS) that hosts web applications. Sqreen supports Heroku for Python applications.

  1. Review Python microagent compatibility to confirm that the Sqreen Microagent for Python is compatible with your application.
  2. Sign up to create your Sqreen account.
  3. Fetch your organization token. From the Sqreen Dashboard, access Account Settings > Environments & Tokens. Your token begins with env_org_. Take note of the token.
  4. Add sqreen in your requirements.txt file.
    sqreen
    
  5. Add sqreen-start at the beginning of the web entry in your Procfile:
    web: sqreen-start gunicorn ...
    
    Alternatively, you can modify your application file (typically wsgi.py or app.py) by adding the following line of code to the very top:
    import sqreen
    sqreen.start()
    
  6. From Terminal, in your application root directory, commit your changes and push them to Heroku. This triggers Heroku to deploy your modifications.
    git commit -m 'Add Sqreen to my application' requirements.txt
    git push heroku master
    
  7. Add your SQREEN_TOKEN environment variable to your environment.

Learn more about using Sqreen with Heroku: