Skip to content
The OpenTelemetry Python Client
Python Thrift
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Build and host docs via github action (#167) Sep 25, 2019
docs Add set_status to Span (#213) Oct 16, 2019
examples Add **simple** client/server examples (#191) Oct 4, 2019
ext Add Jaeger exporter (#174) Oct 8, 2019
opentelemetry-api Add contextmanager for Context (#215) Oct 17, 2019
opentelemetry-sdk Add contextmanager for Context (#215) Oct 17, 2019
.flake8 Add Jaeger exporter (#174) Oct 8, 2019
.gitignore Misc build improvements (build docs & more) (#38) Jul 8, 2019
.isort.cfg Add Jaeger exporter (#174) Oct 8, 2019
.pylintrc Add Jaeger exporter (#174) Oct 8, 2019
.travis.yml Improve testing (#95) Aug 26, 2019
CONTRIBUTING.md
LICENSE Initial commit May 7, 2019
README.md Update README for new milestones (#218) Oct 14, 2019
mypy-relaxed.ini Initial implementation of context (#57) Jul 27, 2019
mypy.ini
pyproject.toml Add Jaeger exporter (#174) Oct 8, 2019
tox.ini Add Jaeger exporter (#174) Oct 8, 2019

README.md

OpenTelemetry Python

Gitter chat

The Python OpenTelemetry client.

Installation

This repository includes multiple installable packages. The opentelemetry-api package includes abstract classes and no-op implementations that comprise the OpenTelemetry API following the specification. The opentelemetry-sdk package is the reference implementation of the API.

Libraries that produce telemetry data should only depend on opentelemetry-api, and defer the choice of the SDK to the application developer. Applications may depend on opentelemetry-sdk or another package that implements the API.

Please note that this library is currently in alpha, and shouldn't be used in production environments.

The API and SDK packages are available on PyPI, and can installed via pip:

pip install opentelemetry-api
pip install opentelemetry-sdk

The ext/ directory includes OpenTelemetry integration packages, which can be installed separately as:

pip install opentelemetry-ext-{integration}

To install the development versions of these packages instead, clone or fork this repo and do an editable install:

pip install -e ./opentelemetry-api
pip install -e ./opentelemetry-sdk
pip install -e ./ext/opentelemetry-ext-{integration}

Quick Start

from opentelemetry import trace
from opentelemetry.context import Context
from opentelemetry.sdk.trace import Tracer
from opentelemetry.sdk.trace.export import ConsoleSpanExporter
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor

trace.set_preferred_tracer_implementation(lambda T: Tracer())
tracer = trace.tracer()
tracer.add_span_processor(
    SimpleExportSpanProcessor(ConsoleSpanExporter())
)
with tracer.start_span('foo'):
    with tracer.start_span('bar'):
        with tracer.start_span('baz'):
            print(Context)

See the API documentation for more detail, and the opentelemetry-example-app for a complete example.

Contributing

See CONTRIBUTING.md

Release Schedule

OpenTelemetry Python is under active development.

The library is not yet generally available, and releases aren't guaranteed to conform to a specific version of the specification. Future releases will not attempt to maintain backwards compatibility with previous releases.

The v0.1 alpha release includes:

  • Tracing API
  • Tracing SDK
  • Metrics API
  • Metrics SDK (Partial)
  • W3C Trace Context Propagation
  • B3 Context Propagation
  • HTTP Integrations

See the project milestones for details on upcoming releases. The dates and features described here are estimates, and subject to change.

Future releases targets include:

Component Version Target Date
Jaeger Trace Exporter Alpha v0.2 October 28 2019
Metrics SDK (Complete) Alpha v0.2 October 28 2019
Prometheus Metrics Exporter Alpha v0.2 October 28 2019
OpenTracing Bridge Alpha v0.2 October 28 2019
Component Version Target Date
Zipkin Trace Exporter Alpha v0.3 November 15 2019
W3C Correlation Context Propagation Alpha v0.3 November 15 2019
Support for Tags/Baggage Alpha v0.3 November 15 2019
Metrics Aggregation Alpha v0.3 November 15 2019
gRPC Integrations Alpha v0.3 November 15 2019
Component Version Target Date
OpenCensus Bridge Alpha v0.4 December 31 2019
You can’t perform that action at this time.