Skip to content

Lightstep OpenTelemetry Configuration Layer for Python

License

Notifications You must be signed in to change notification settings

ocelotl/otel-python

 
 

Repository files navigation

build status PyPI version

Lightstep OpenTelemetry Configuration Layer for Python

NOTE: the code in this repo is currently in alpha and will likely change

This is the Lightstep package for configuring OpenTelemetry

Install

pip install opentelemetry-lightstep

Configure

Minimal setup

from opentelemetry.lightstep import configure_opentelemetry

configure_opentelemetry(
    service_name="service-123",
    token="my-token",  # optional
)
tracer = trace.get_tracer(__name__)

with tracer.start_as_current_span("foo") as span:
    span.set_attribute("attr1", "valu1")
    with tracer.start_as_current_span("bar"):
        with tracer.start_as_current_span("baz"):
            print("Hello world from OpenTelemetry Python!")

Additional tracer options

configure_opentelemetry(
    service_name="service-123",
    service_version="1.2.3",
    token="my-token",
    satellite_url="ingest.lightstep.com:443",
    metrics_url="ingest.lightstep.com:443/metrics",
    debug=False,
)

Configuration Options

Config Env Variable Required Default
service_name LS_SERVICE_NAME y -
service_version LS_SERVICE_VERSION n unknown
token LS_ACCESS_TOKEN n -
satellite_url LS_SATELLITE_URL n ingest.lightstep.com:443
metrics_url LS_METRICS_URL n ingest.lightstep.com:443/metrics
debug LS_DEBUG n False

About

Lightstep OpenTelemetry Configuration Layer for Python

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%