sonar-tracing
One-line OpenTelemetry tracing for AI agents, across frameworks.
import sonar_tracing as tracing
tracing.init(service_name="support-agent", framework="strands")
with tracing.identity(tenant_id="acme", session_id=session_id):
result = agent(prompt)
That is the whole integration. No exporter wiring, no TracerProvider, no OTLP
setup — init() builds the production processor/exporter chain for you and
identity() stamps tenant/session context onto every span in scope.
Install
pip install sonar-tracing
Framework support ships as a separate package. For AWS Strands, also install the adapter — it registers itself, so there is nothing to import:
pip install sonar-tracing sonar-tracing-strands
What it does
init()— stands up aTracerProviderwired to an OTLP HTTP exporter, with redaction and identity-stamping built into the pipeline.identity()— a context manager that attaches tenant/session attributes to spans created within it.- Framework support is a plugin, not a branch. Adapters are discovered from
the
sonar_tracing.adaptersentry point group, so a new framework ships as a new package — core never changes.
Requirements
- Python 3.11+
- An OTLP-compatible collector endpoint
License
MIT — see LICENSE.
Metadata
Release files for sonar-tracing 0.5.3
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 |
|---|---|---|---|---|
| sonar_tracing-0.5.3.tar.gz | 31.7 kB | With provenance | Details for sonar_tracing-0.5.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sonar_tracing-0.5.3-py3-none-any.whl | Python 3 | none | any | Details for sonar_tracing-0.5.3-py3-none-any.whl |
Total release size: 62.6 kB
Release files / sonar_tracing-0.5.3.tar.gz
| Download URL | sonar_tracing-0.5.3.tar.gz |
|---|---|
| Size | 31.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
eb2e73e7ccc5088a11d9653e72801b2ad7d056a68562ed32c6661fda07415ea3
|
|
BLAKE2b-256 checksum How to use checksums |
b7762d82b75b0257918a24a9a8c0023318485a035aee8e612fb1955c84a379e1
|
| 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 9, 2026.
Transparency logRelease files / sonar_tracing-0.5.3-py3-none-any.whl
| Download URL | sonar_tracing-0.5.3-py3-none-any.whl |
|---|---|
| Size | 30.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
fa4bb8f3dc58324b57ca7c815b7bce57030669d1291c1148339739e41c432054
|
|
BLAKE2b-256 checksum How to use checksums |
7d9c02fb940779f8e820bee8e0cc8499d39496078ada1ab9a88bff3ce9d8340c
|
| 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 9, 2026.
Transparency logSecurity for sonar-tracing 0.5.3
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 sonar_tracing-0.5.3.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 9, 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.