otelstarter (Python)
Business-aware domain events for OpenTelemetry. Part of otelstarter.
from otelstarter import observability
observability.event(
"payment.completed",
domain="payments",
operation="payment",
outcome="success",
entity_type="payment",
entity_id=payment.id,
)
Each call emits one OpenTelemetry log-based event: a log record whose event name is payment.completed, linked to the current trace. OpenTelemetry adds the trace and span IDs, service name and environment itself.
Install
The package is not on PyPI yet. Install it from GitHub:
pip install "otelstarter @ git+https://github.com/IvyMurage/otelstarter#subdirectory=sdk/python"
It depends only on opentelemetry-api. Run your app with OpenTelemetry configured (for example via otelstarter run -- <your command>), or event() quietly does nothing.
Rules it enforces
- Business meaning, not payloads. Only the named fields above exist, with values that are short strings or ints. Anything else is left out with a warning.
<domain>.<action>names, in lowercase, such asorder.createdorpayment.authorization.failed. A name that breaks the rule is still recorded, with a one-timeOtelStarterWarning.- Never breaks your app.
event()never raises. Internal errors become a one-timeOtelStarterWarning. - One signal per event. No duplicate span event or log line, and no automatic metric, so
entity_idnever becomes a metric label.
Finding events in Grafana
With otelstarter run, open Grafana → Explore → Loki:
{service_name="shop"} |= "payment." # all payment events
{service_name="shop"} | event_domain="payments" # by domain
{service_name="shop"} | event_outcome="failure" # failures only
Each event carries trace_id, so you can jump from it to the request's trace in Tempo. Loki does not store OpenTelemetry's event-name field, which is why the event name is also the log body.
See docs/DOMAIN_EVENTS.md for the event model.
Development
cd sdk/python
python -m venv .venv && . .venv/bin/activate
pip install -e '.[dev]'
pytest
ruff check . && ruff format --check .
mypy
Metadata
Release files for otelstarter 0.1.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 | |
|---|---|---|---|
| otelstarter-0.1.0.tar.gz | 10.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| otelstarter-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.4 kB
Release files / otelstarter-0.1.0.tar.gz
| Download URL | otelstarter-0.1.0.tar.gz |
|---|---|
| Size | 10.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5550017b204aed6f90bdc2162678441d2faae49143bb8404204ded56e403f596
|
|
BLAKE2b-256 checksum How to use checksums |
7e26423c932ba0f77dc8b8093a681945a2632929c367ec92bb7ff6b7fe3fbf9b
|
| 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 Oct 6, 2026.
Transparency logRelease files / otelstarter-0.1.0-py3-none-any.whl
| Download URL | otelstarter-0.1.0-py3-none-any.whl |
|---|---|
| Size | 8.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b23aa840f7fedea9087a2dbc8d35c8685c3187440bbf53c568a85a2e6b027689
|
|
BLAKE2b-256 checksum How to use checksums |
be0cec1e14c8d9d202616ea623f59fd1082b32a5713e43ef6d3ba65bc7deb260
|
| 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 Oct 6, 2026.
Transparency log