{"id":15282728,"url":"https://github.com/lightstep/otel-launcher-python","last_synced_at":"2025-04-12T23:08:49.358Z","repository":{"id":39578589,"uuid":"273365792","full_name":"lightstep/otel-launcher-python","owner":"lightstep","description":"Launcher, a Lightstep Distro for OpenTelemetry Python 🚀","archived":false,"fork":false,"pushed_at":"2023-10-31T16:57:14.000Z","size":236,"stargazers_count":18,"open_issues_count":3,"forks_count":10,"subscribers_count":50,"default_branch":"main","last_synced_at":"2025-04-12T23:08:38.083Z","etag":null,"topics":["opentelemetry","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lightstep.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-06-19T00:11:52.000Z","updated_at":"2024-04-24T15:31:22.000Z","dependencies_parsed_at":"2024-06-20T19:08:15.164Z","dependency_job_id":"dcb15394-a7b8-433e-98c5-5e999c482c85","html_url":"https://github.com/lightstep/otel-launcher-python","commit_stats":{"total_commits":121,"total_committers":7,"mean_commits":"17.285714285714285","dds":0.5206611570247934,"last_synced_commit":"f26f0e3e843e90f347f9fdb75a340effbfe26dbb"},"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fotel-launcher-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fotel-launcher-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fotel-launcher-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lightstep%2Fotel-launcher-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lightstep","download_url":"https://codeload.github.com/lightstep/otel-launcher-python/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643004,"owners_count":21138355,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["opentelemetry","python"],"created_at":"2024-09-30T14:37:06.434Z","updated_at":"2025-04-12T23:08:49.329Z","avatar_url":"https://github.com/lightstep.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![build status](https://github.com/lightstep/otel-launcher-python/workflows/Python%20package/badge.svg) [![PyPI version](https://badge.fury.io/py/opentelemetry-launcher.svg)](https://badge.fury.io/py/opentelemetry-launcher) [![Downloads](https://pepy.tech/badge/opentelemetry-launcher)](https://pepy.tech/project/opentelemetry-launcher)\n\n# Launcher, a Lightstep Distro for OpenTelemetry 🚀 [Deprecated]\n\nIn August 2023, [Lightstep became ServiceNow\nCloud Observability](https://docs.lightstep.com/docs/banner-faq). To ease the\ntransition, all code artifacts will continue to use the Lightstep name. You\ndon't need to do anything to keep using this repository.\n\n### What is Launcher?\n\nLauncher 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.\n\n### Getting started\n\n```bash\npip install opentelemetry-launcher\n```\n\n### Configure\n\nMinimal setup\n\n```python\nfrom opentelemetry.launcher import configure_opentelemetry\nfrom opentelemetry import trace\n\nconfigure_opentelemetry(\n    service_name=\"service-123\",\n    access_token=\"my-token\",  # optional\n)\n\ntracer = trace.get_tracer(__name__)\n\nwith tracer.start_as_current_span(\"foo\") as span:\n    span.set_attribute(\"attr1\", \"valu1\")\n    with tracer.start_as_current_span(\"bar\"):\n        with tracer.start_as_current_span(\"baz\"):\n            print(\"Hello world from OpenTelemetry Python!\")\n\n```\n\nAdditional tracer options\n\n```python\nconfigure_opentelemetry(\n    service_name=\"service-123\",\n    service_version=\"1.2.3\",\n    access_token=\"my-token\",\n    span_exporter_endpoint=\"https://ingest.lightstep.com:443\",\n    log_level=debug,\n    span_exporter_insecure=False,\n)\n\n```\n\n### Usage with Auto Instrumentation\n\nOpenTelemetry Python includes a command that allows the user to automatically instrument\ncertain third party libraries. Here is an example that shows how to use this launcher\nwith auto instrumentation.\n\nFirst, create a new virtual environment:\n\n```bash\ncd ~\nmkdir auto_instrumentation\nvirtualenv auto_instrumentation\nsource auto_instrumentation/bin/activate\npip install opentelemetry-launcher\npip install requests\npip install flask\nopentelemetry-bootstrap -a install\n```\n\nOnce that is done, clone the `opentelemetry-python` repo to get the example code:\n\n```bash\ngit clone git@github.com:open-telemetry/opentelemetry-python.git\ncd opentelemetry-python\ngit checkout v1.1.0\n```\n\nSet the environment variables:\n\n```bash\nexport OTEL_SERVICE_NAME=auto-instrumentation-testing\nexport LS_ACCESS_TOKEN=\u003cmy-token\u003e\n```\n\nRun the server:\n\n```bash\ncd docs/examples/auto-instrumentation\nopentelemetry-instrument python server_uninstrumented.py\n```\n\nRun the client in a separate console:\n\n```bash\ncd docs/examples/auto-instrumentation\npython client.py testing\n```\n\nThis should produce spans that can be captured in the Lightstep Explorer.\n\n### Configuration Options\n\n|Config|Env Variable|Required|Default|\n|------|------------|--------|-------|\n|service_name|OTEL_SERVICE_NAME|y|-|\n|service_version|LS_SERVICE_VERSION|n|`None`|\n|access_token|LS_ACCESS_TOKEN|n|`None`|\n|metrics_enabled|LS_METRICS_ENABLED|n|`False`|\n|span_exporter_endpoint|OTEL_EXPORTER_OTLP_TRACES_ENDPOINT|n|`https://ingest.lightstep.com:443`|\n|span_exporter_insecure|OTEL_EXPORTER_OTLP_TRACES_INSECURE|n|`False`|\n|propagators|OTEL_PROPAGATORS|n|`b3`|\n|resource_attributes|OTEL_RESOURCE_ATTRIBUTES|n|`telemetry.sdk.language=python,telemetry.sdk.version=0.12b0`|\n|log_level|OTEL_LOG_LEVEL|n|`ERROR`|\n|metrics_exporter_endpoint|OTLP_EXPORTER_METRICS_ENDPOINT|n|`https://ingest.lightstep.com:443`|\n|metrics_exporter_temporality_preference|OTLP_EXPORTER_METRICS_TEMPORALITY_PREFERENCE|n|`cumulative`|\n\nThe 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\"]`.\nThe 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}`.\n\n#### Note about metrics\n\nMetrics support is still **experimental**.\n\n### Principles behind Launcher\n\n##### 100% interoperability with OpenTelemetry\n\nOne 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.\n\n##### Validation\n\nAnother 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.\n\nStart using it today in [Go](https://github.com/lightstep/otel-launcher-go), [Java](https://github.com/lightstep/otel-launcher-java), [Javascript](https://github.com/lightstep/otel-launcher-node) and [Python](https://github.com/lightstep/otel-launcher-python) and let us know what you think!\n\n------\n\n*Made with* ![:heart:](https://a.slack-edge.com/production-standard-emoji-assets/10.2/apple-medium/2764-fe0f.png) *@ [Lightstep](http://lightstep.com/)*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fotel-launcher-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flightstep%2Fotel-launcher-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flightstep%2Fotel-launcher-python/lists"}