Skip to main content

High performace C++ implementation of LightStep tracing

Project description

LightStep Streaming: Our Streaming Python Tracer

The Streaming Python Tracer, is an OpenTracing tracer which sends data to LightStep Satellites.

This tracer sends data to multiple Satellites concurrently using non-blocking I/O writes. Memory is carefully managed so that spans are only copied a single time during the reporting process and streamed to Satellites as they are generated to avoid filling up memory. The Streaming Python Tracer is written in C++. There is a thin Python wrapper around this C++ core so the library can be imported just like any other Python module.

Setup

If you aren't familiar with OpenTracing or LightStep, we recommend reading up before continuing.

Before installing, make sure that you system meets these requirements:

  • Linux
  • Python 2.7 or >= 3.2.0 (and pip)
  • opentracing PyPI Module (>=2.2.0)

To install the Streaming Python Tracer, run pip install lightstep-streaming.

Getting Started

The beauty of OpenTracing is that all tracers follow a well-defined API. The only step which varies from tracer to tracer is the setup step when lightstep_streaming.Tracer's constructor is called. Below is a sample program which illustrates how to create a new Tracer object using the Streaming Python Tracer. For more details on how to use a Tracer object once it has been created, checkout the OpenTracing Python API Guide.

import lightstep_streaming

tracer = lightstep_streaming.Tracer(
    component_name='[your service name]',
    access_token='[your LightStep access token]',

    # Use these defaults unless you know what you're doing
    use_stream_recorder=True,
    collector_plaintext=True,

    # You can put any number of Satellite endpoints in this list and the tracer
    # will rotate through them and send spans to each one.
    satellite_endpoints=[{'host': 'localhost', 'port': 8360}],

    # Turns off verbose logging, which is really only useful for debugging.
    verbose=False
)

# Generates one span
with tracer.start_active_span('[your operation name]'):
    pass

# Makes sure that the tracer has sent the span to a Satellite
tracer.flush()

A complete list of Streaming Python Tracer configuration parameters can be found in tracer_configuration.schema.json. If you are interested in peeking at the source code, this is available in the LightStep C++ Tracer repo.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

File details

Details for the file lightstep_streaming-0.12.0-cp32-abi3-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lightstep_streaming-0.12.0-cp32-abi3-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7165304313e249fd8a3299c9076dbd151270e1622da916e47c139b44bf08baee
MD5 37e1ee2978b7591b4c3ad9f333f6bd2c
BLAKE2b-256 aeef3b638ed2da1c8f411056a416e0d284c7578178d200cb6ca2fc7124f7ef87

See more details on using hashes here.

File details

Details for the file lightstep_streaming-0.12.0-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lightstep_streaming-0.12.0-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 99d0027053bd105a8c7a080567d6b37f753cfbfbfba0987b1a1af98a944ca153
MD5 6ce88cacd85897deaf84e7562c4fca78
BLAKE2b-256 bb29a3636e0027809e3484575b448a0027f2bb1442399f8a2376d30e55e2b8d0

See more details on using hashes here.

File details

Details for the file lightstep_streaming-0.12.0-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for lightstep_streaming-0.12.0-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 4fdc95f6627a30312fc1f273b7c2a921daec1e4787b65d216742b2e0316f0da4
MD5 cf2bb4eadb488d1886805f3a38b6bbbc
BLAKE2b-256 65d566ef77bcbc6d33686c2f15ff8c796b282ef0c7e9e90ff8c37258cbfaf797

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page