Python - The Instana Python Package

Stan Loves Python

The Instana Python package: Python Distributed Tracing & Metrics Sensor

Build Status OpenTracing Badge

Usage

The Instana Python package is a zero configuration tool that will automatically collect key metrics and distributed traces from your Python processes.

Installation

None

Instana remotely instruments your Python web servers automatically. To configure which Python processes this applies to, see the configuration page.

Manual Installation

If you wish to manually instrument your applications you can install the package with the following into the virtualenv, pipenv or container (hosted on pypi):

pip install instana

or to alternatively update an existing installation:

pip install -U instana

Activating Without Code Changes

The Instana package can then be activated without any code changes required by setting the following environment variable for your Python application:

export AUTOWRAPT_BOOTSTRAP=instana

This will cause the Instana Python package to automatically instrument your Python application. Once it finds the Instana host agent, it will begin to report Python metrics and distributed traces.

Activating via Import

Alternatively, if you prefer the really manual method, simply import the instana package inside of your Python application:

import instana

See also our detailed Installation document for additional information covering Django, Flask, End-user Monitoring (EUM) and more.

Configuration

Although the package has no configuration required for out of the box metrics and distributed tracing, individual components can be configured as needed. See the Python configuration page for more information.

Custom Tracing

The Instana Python package supports custom tracing via OpenTracing APIs. See the OpenTracing page for more information.

Troubleshooting

Seeing something unexpected or having trouble trying to configure something? See the Python Troubleshooting page for help.

Releases

To see the Instana Python package release history, which also details the changes made in the Instana package, please see the Github Releases page.

See Also