ko-observability (Python)
Org-wide OpenTelemetry bootstrap for Python services: one-call, idempotent
init_otel for process startup, lazy get_tracer / get_meter accessors for library code
that doesn't own process lifecycle, and a structlog processor (otel_bridge /
make_otel_bridge) that stamps each log line with the active span's trace_id/span_id.
Install
pip install ko-observability
Optional extras, install alongside the base package as needed:
# Auto-instrument FastAPI request/response spans
pip install "ko-observability[fastapi]"
# Auto-instrument outbound httpx calls
pip install "ko-observability[httpx]"
# Auto-instrument the Elasticsearch client
pip install "ko-observability[elasticsearch]"
# Read your own service's telemetry back out (admin-panel style queries)
pip install "ko-observability[query]"
Quick start
from ko_observability import init_otel, get_tracer
init_otel(service_name="my-service", service_namespace="nexora")
tracer = get_tracer(__name__)
with tracer.start_as_current_span("do-work"):
...
Call init_otel exactly once at process startup. It's safe to call again (or to let library
code fall back to get_tracer/get_meter before it runs) — both paths are no-ops on top of an
already-configured provider. OTEL_SDK_DISABLED=true turns the whole thing into a no-op, and a
misconfigured exporter degrades to "telemetry doesn't work" rather than crashing the host process.
Where does it go?
TELEMETRY_DESTINATION |
Output |
|---|---|
file (default) |
$TELEMETRY_FILE_DIR/{traces,metrics,logs}.jsonl (default ./telemetry), one OTLP/JSON request per line |
otlp |
OTLP/gRPC to OTEL_EXPORTER_OTLP_ENDPOINT (default http://localhost:4317) |
Full contract: docs/otel.md → Local file mode.
Reading telemetry back (query extra)
from ko_observability.query import get_query_client
client = get_query_client()
traces = client.list_traces(limit=20)
Scoped to the caller's own service_name by default. See docs/query.md.
Docs
Full documentation — env vars, the logs/metrics pipelines, semantic conventions, and the Collector deployment this SDK ships telemetry to — lives in the repository:
https://github.com/Komus-ai/nexora-observability/tree/main/docs
Metadata
Release files for ko-observability 0.2.1
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 | Actions |
|---|---|---|---|---|
| ko_observability-0.2.1.tar.gz | 76.2 kB | With provenance | Details for ko_observability-0.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ko_observability-0.2.1-py3-none-any.whl | Python 3 | none | any | Details for ko_observability-0.2.1-py3-none-any.whl |
Total release size: 94.6 kB
Release files / ko_observability-0.2.1.tar.gz
| Download URL | ko_observability-0.2.1.tar.gz |
|---|---|
| Size | 76.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7d5280973f916143d42e6dbff966e0758d615e9427fb944d37114466816f773a
|
|
BLAKE2b-256 checksum How to use checksums |
bf1e21dc5ed813d13c66a634cf9d2daf319005e55faf596906af9f172d539537
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logRelease files / ko_observability-0.2.1-py3-none-any.whl
| Download URL | ko_observability-0.2.1-py3-none-any.whl |
|---|---|
| Size | 18.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8282f10fae443ae9c35a13b895bd8c8636a82934dcba9c5d88ee0cfb788e0d2a
|
|
BLAKE2b-256 checksum How to use checksums |
db36118c1ca172d7a71553b92b05220b6194076e7945bd6f3e411c9b5d12efff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logSecurity for ko-observability 0.2.1
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.
Full provenance
All 2 files in this release have been uploaded with provenance metadata.
Attestation for ko_observability-0.2.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Sep 18, 2026.
Transparency logA 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.