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

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.4.0
File Size Uploaded Provenance Actions
sonar_tracing-0.4.0.tar.gz 31.7 kB With provenance Details for sonar_tracing-0.4.0.tar.gz

Built distribution (wheel)

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

Total release size: 62.6 kB

Release files / sonar_tracing-0.4.0.tar.gz

Download URL sonar_tracing-0.4.0.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d7fb94b123917dbacc7cbc8901d39e17bb1ff4b0a055c581226116c6fa150923
BLAKE2b-256 checksum
How to use checksums
e2614ce42b01d93bf3b4b808cb8e36a1cd6fea3b7e861b38fc62ebdbc33d5e86
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 Aug 31, 2026.

Transparency log

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

Download URL sonar_tracing-0.4.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
655a71c6e1ebcfd886f346adce6262cfedc3d920ddfc447c6e2678314fa43af3
BLAKE2b-256 checksum
How to use checksums
1a53827008d97fef3c84a7604ea3c0d97677f143f36aa839d0ca46a858077569
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 Aug 31, 2026.

Transparency log

Security for sonar-tracing 0.4.0

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.4.0.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 Aug 31, 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