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

Built distribution (wheel)

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

Total release size: 62.6 kB

Release files / sonar_tracing-0.5.0.tar.gz

Download URL sonar_tracing-0.5.0.tar.gz
Size 31.7 kB
Tags Source
SHA-256 checksum
How to use checksums
808445e9670d34da6a4df3840d2bf0a582d95642a0298794fdce0ae898a2ce58
BLAKE2b-256 checksum
How to use checksums
bdba676a5df45e516e3f17643d77a497e022b10f435bef68128260b6d686a184
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 1, 2026.

Transparency log

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

Download URL sonar_tracing-0.5.0-py3-none-any.whl
Size 30.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
11b67f354bc759becdca26b201422e245f87fd2f959fd940234d1d2924b72dae
BLAKE2b-256 checksum
How to use checksums
5299bc15d1dd35e6721e8263e72ec5c303ee47df1462c6432ffaf1612b41985b
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 1, 2026.

Transparency log

Security for sonar-tracing 0.5.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.5.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 Sep 1, 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