The Instana Python package: Python Distributed Tracing & Metrics Sensor
The Instana Python package is a zero configuration tool that will automatically collect key metrics and distributed traces from your Python processes.
Instana remotely instruments your Python web servers automatically. To configure which Python processes this applies to, see the configuration page.
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:
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:
See also our detailed Installation document for additional information covering Django, Flask, End-user Monitoring (EUM) and more.
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.
The Instana Python package includes an API client that can be used to access the raw data of your Instana dashboard using the Instana REST API. Download metrics, views, events and more.
For details on how to use this Python API client with examples, please see the documentation here.
The Instana Python package supports custom tracing via OpenTracing APIs. See the OpenTracing page for more information.
Seeing something unexpected or having trouble trying to configure something? See the Python Troubleshooting page for help.
To see the Instana Python package release history, which also details the changes made in the Instana package, please see the Github Releases page.