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.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sonar_tracing-0.1.0.tar.gz.
File metadata
- Download URL: sonar_tracing-0.1.0.tar.gz
- Upload date:
- Size: 31.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
37ef82307b2eaeed1d0af7f02333d0eb663c9c6662ffcc3bd05d7c9936435f75
|
|
| MD5 |
bd7c62d1e450807cf7b09cc7b4f77f06
|
|
| BLAKE2b-256 |
58c3a2b76dd214eafb8016b2f12e88cf761ec9041a08ade91e00c25b93774294
|
Provenance
The following attestation bundles were made for sonar_tracing-0.1.0.tar.gz:
Publisher:
publish.yml on deep-dive-mexico/sonar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sonar_tracing-0.1.0.tar.gz -
Subject digest:
37ef82307b2eaeed1d0af7f02333d0eb663c9c6662ffcc3bd05d7c9936435f75 - Sigstore transparency entry: 2468637021
- Sigstore integration time:
-
Permalink:
deep-dive-mexico/sonar@b04ed1e0b86824a2b0c627537352364aa223b6e5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/deep-dive-mexico
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b04ed1e0b86824a2b0c627537352364aa223b6e5 -
Trigger Event:
release
-
Statement type:
File details
Details for the file sonar_tracing-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sonar_tracing-0.1.0-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
785c9c40b9d5e0ed78b88c4001a2fd23704322c91c77ebd198aeadf6041e17e3
|
|
| MD5 |
12d8fe091afbb028cb8d83274c2582bf
|
|
| BLAKE2b-256 |
2d961922eeb0b7431dfa09250123d63ebb63d279d64ccd3aea0b0e0587d575a0
|
Provenance
The following attestation bundles were made for sonar_tracing-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on deep-dive-mexico/sonar
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
sonar_tracing-0.1.0-py3-none-any.whl -
Subject digest:
785c9c40b9d5e0ed78b88c4001a2fd23704322c91c77ebd198aeadf6041e17e3 - Sigstore transparency entry: 2468637067
- Sigstore integration time:
-
Permalink:
deep-dive-mexico/sonar@b04ed1e0b86824a2b0c627537352364aa223b6e5 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/deep-dive-mexico
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@b04ed1e0b86824a2b0c627537352364aa223b6e5 -
Trigger Event:
release
-
Statement type: