Skip to main content

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 a TracerProvider wired 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.adapters entry 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.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sonar-tracing 0.5.1
File Size Uploaded Provenance Actions
sonar_tracing-0.5.1.tar.gz 31.7 kB With provenance Details for sonar_tracing-0.5.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sonar-tracing 0.5.1
File Interpreter ABI Platform Actions
sonar_tracing-0.5.1-py3-none-any.whl Python 3 none any Details for sonar_tracing-0.5.1-py3-none-any.whl

Total release size: 62.6 kB

Release files / sonar_tracing-0.5.1.tar.gz

Download URL sonar_tracing-0.5.1.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
f642c09139207131f502f27bd65fac77f3fd797264c9e929f013329dc20effc3
BLAKE2b-256 checksum
How to use checksums
e2247e1539625f0340c5ee2719b4e994489d2f2d89685a96713fa5b261bd58be
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 4, 2026.

Transparency log

Release files / sonar_tracing-0.5.1-py3-none-any.whl

Download URL sonar_tracing-0.5.1-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8f3c7b8975338b7a5c50c173eaec9c75dd630c5a30a241d5126d867464d742ed
BLAKE2b-256 checksum
How to use checksums
acb5748aeaa7084d69fdfffe2e0e5a9693805742632fe1ecdd809b0e22e995a7
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 4, 2026.

Transparency log

Security for sonar-tracing 0.5.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.

Select from 2 files

Attestation for sonar_tracing-0.5.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 4, 2026.

Transparency log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page