If your app is written in Python, you can get started quickly with LightStep. Download the Auto-Installer, then configure it to communicate with your LightStep Satellites. When you deploy your app, all supported frameworks, data stores, and libraries will begin sending trace data to LightStep.
For Python Django applications, note that tracing is disabled when your application is launched in DEBUG mode.
Python versions 2.7 and 3.4 and up are supported.
Install the Python Auto-Installer, using pip.
pip install ls-trace
LightStep recommends using B3 headers for trace propagation as the default, especially on hybrid deployments, as it is the most widely supported header at this time.
from ddtrace import tracer from ddtrace.propagation.b3 import B3HTTPPropagator tracer.configure(http_propagator=B3HTTPPropagator)
To send data from your system to LightStep, you need to configure the Auto-Installer to:
- Point to your Satellites
- Send global tags required by LightStep to ingest and display the data to you.
To configure the Auto-Installer:
Configure the Auto-Installer to point to the LightStep Satellites by setting these environment variables. Use the right values, depending on if you are using on-premise, LightStep public, or Developer Mode Satellites.
DD_TRACE_AGENT_URL=https://<Satellite host>:<Satellite port> DD_TRACE_GLOBAL_TAGS="lightstep.service_name:<service_name>,lightstep.access_token:<access_token>"
Where to find the host and port values for on-premise?
This is your pool address, found in your configuration file.
When setting the environment variable
DD_TRACE_GLOBAL_TAGS, the following variables must be included:
The name of the service from which spans originate.
This tag allows LightStep to accurately report on your services, with features such as the Service diagram and the Service Directory
The access token for the project the tracers report to.
LightStep Satellites need this token to accept and store span data from the tracer. Reports from clients with invalid or deactivated access tokens will be rejected on ingress.
To include the Auto-Installer's auto-instrumentation, prefix your Python entry-point command with
For example, if your application is started with
python app.py then:
$ ls-trace-run python app.py
|Flask Cache||>= 0.12|
|Memcached pylibmc||>= 1.4|
|Memcached pymemcache||>= 1.3|
|MongoDB Mongoengine||>= 0.11|
|MongoDB Pymongo||>= 3.0|
|MySQL MySQL-python||>= 1.2.3|
|MySQL mysqlclient||>= 1.3|
|MySQL mysql-connector||>= 2.1|
|Postgres aiopg||>= 0.12.0|
|Postgres psycopg||>= 2.4|
|Redis redis-py-cluster||>= 1.3.5|
Updated about a month ago