Launcher, a Lightstep Distro for OpenTelemetry 🚀 [Deprecated]
In August 2023, Lightstep became ServiceNow Cloud Observability. To ease the transition, all code artifacts will continue to use the Lightstep name. You don't need to do anything to keep using this repository.
What is Launcher?
Launcher is a configuration layer that chooses default values for configuration options that many OpenTelemetry users want. It provides a single function in each language to simplify discovery of the options and components available to users. The goal of Launcher is to help users that aren't familiar with OpenTelemetry quickly ramp up on what they need to get going and instrument.
Getting started
pip install opentelemetry-launcher
Configure
Minimal setup
from opentelemetry.launcher import configure_opentelemetry
from opentelemetry import trace
configure_opentelemetry(
service_name="service-123",
access_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",
access_token="my-token",
span_exporter_endpoint="https://ingest.lightstep.com:443",
log_level=debug,
span_exporter_insecure=False,
)
Usage with Auto Instrumentation
OpenTelemetry Python includes a command that allows the user to automatically instrument certain third party libraries. Here is an example that shows how to use this launcher with auto instrumentation.
First, create a new virtual environment:
cd ~
mkdir auto_instrumentation
virtualenv auto_instrumentation
source auto_instrumentation/bin/activate
pip install opentelemetry-launcher
pip install requests
pip install flask
opentelemetry-bootstrap -a install
Once that is done, clone the opentelemetry-python repo to get the example code:
git clone git@github.com:open-telemetry/opentelemetry-python.git
cd opentelemetry-python
git checkout v1.1.0
Set the environment variables:
export OTEL_SERVICE_NAME=auto-instrumentation-testing
export LS_ACCESS_TOKEN=<my-token>
Run the server:
cd docs/examples/auto-instrumentation
opentelemetry-instrument python server_uninstrumented.py
Run the client in a separate console:
cd docs/examples/auto-instrumentation
python client.py testing
This should produce spans that can be captured in the Lightstep Explorer.
Configuration Options
| Config | Env Variable | Required | Default |
|---|---|---|---|
| service_name | OTEL_SERVICE_NAME | y | - |
| service_version | LS_SERVICE_VERSION | n | None |
| access_token | LS_ACCESS_TOKEN | n | None |
| metrics_enabled | LS_METRICS_ENABLED | n | False |
| span_exporter_endpoint | OTEL_EXPORTER_OTLP_TRACES_ENDPOINT | n | https://ingest.lightstep.com:443 |
| span_exporter_insecure | OTEL_EXPORTER_OTLP_TRACES_INSECURE | n | False |
| propagators | OTEL_PROPAGATORS | n | b3 |
| resource_attributes | OTEL_RESOURCE_ATTRIBUTES | n | telemetry.sdk.language=python,telemetry.sdk.version=0.12b0 |
| log_level | OTEL_LOG_LEVEL | n | ERROR |
| metrics_exporter_endpoint | OTLP_EXPORTER_METRICS_ENDPOINT | n | https://ingest.lightstep.com:443 |
| metrics_exporter_temporality_preference | OTLP_EXPORTER_METRICS_TEMPORALITY_PREFERENCE | n | cumulative |
The configuration option for propagators accepts a comma-separated string that will be interpreted as a list. For example, a,b,c,d will be interpreted as ["a", "b", "c", "d"].
The configuration option for resource_attributes accepts a comma-separated string of key=value pairs that will be interpreted as a dictionary. For example, a=1,b=2,c=3,d=4 will be interpreted as {"a": 1, "b": 2, "c": 3, "d": 4}.
Note about metrics
Metrics support is still experimental.
Principles behind Launcher
100% interoperability with OpenTelemetry
One of the key principles behind putting together Launcher is to make lives of OpenTelemetry users easier, this means that there is no special configuration that requires users to install Launcher in order to use OpenTelemetry. It also means that any users of Launcher can leverage the flexibility of configuring OpenTelemetry as they need.
Validation
Another decision we made with launcher is to provide end users with a layer of validation of their configuration. This provides us the ability to give feedback to our users faster, so they can start collecting telemetry sooner.
Start using it today in Go, Java, Javascript and Python and let us know what you think!
Made with @ Lightstep
Metadata
Release files for opentelemetry-launcher 1.16.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| opentelemetry-launcher-1.16.0.tar.gz | 18.2 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| opentelemetry_launcher-1.16.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 34.2 kB
Release files / opentelemetry-launcher-1.16.0.tar.gz
| Download URL | opentelemetry-launcher-1.16.0.tar.gz |
|---|---|
| Size | 18.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ef3bb1e35c11c7bc82d01429b3c67cc2eb500414230dffdc4fdbb989f4f55229
|
|
BLAKE2b-256 checksum How to use checksums |
81e445ac37ca3ca5a8071cebba33c50f58b1f22250a6cb99a542e24f9f09595b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Release files / opentelemetry_launcher-1.16.0-py3-none-any.whl
| Download URL | opentelemetry_launcher-1.16.0-py3-none-any.whl |
|---|---|
| Size | 16.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d03a74262996e5981523d8c78aada4652bab879d5d917ede51f7048644a46e21
|
|
BLAKE2b-256 checksum How to use checksums |
2c36e9470fd506e5c98e8baee73ce50daf6243b3dd3de0515fc3e594c7ee8da5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.12.0
|
Security for opentelemetry-launcher 1.16.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.