Skip to main content

Respan LiveKit instrumentation

Translate LiveKit Agents' native tracing into Respan spans while preserving the SDK's stream, tool execution and Session APIs. This package supports livekit-agents>=1.6.0,<2; controlled native SDK validation covers 1.6.0 and 1.8.4. The optional OpenAI companion was tested at matching versions 1.6.0 and 1.8.4, with its released OpenAI dependency bounds (the current companion requires<3).

pip install respan-tracing respan-instrumentation-livekit livekit-plugins-openai
import os
from respan_tracing import RespanTelemetry
from respan_instrumentation_livekit import LiveKitInstrumentor

telemetry = RespanTelemetry(
    api_key=os.environ["RESPAN_API_KEY"],
    app_name="livekit-example",
    is_auto_instrument=False,
)
owner = LiveKitInstrumentor()
owner.activate()
# Run the normal LiveKit LLMStream or AgentSession APIs here.
# Close the SDK's streams/session before releasing the owner.
owner.deactivate()

Native LLMStream request spans become chat spans with model/provider fields, messages, current tool calls, complete available tool schemas and actual usage. OpenAI SSE usage is observed before DTO coercion. Missing, boolean, negative or otherwise unproven token counts are omitted; complete actual input/output counts can produce a total. Counts observed before a failed stream remain available.

execute_function_call emits one tool span with the actual result, invocation ID and declaring request parent when its original call object is available. Existing Session function_tool spans are translated in place, including native error flags, without an additional tool span. Session's native string rendering of tool results is retained; utility calls retain structured raw results. Complete dense and sparse vectors are retained in known tool values. Errors do not invent output, usage or HTTP status; an actual SDK HTTP status is preserved when provided. Other native SDK spans retain their graph and use task common fields.

Content capture has an initial upper bound and an irreversible veto at later checkpoints. LiveKitInstrumentor(capture_content=False), Respan content context, TRACELOOP_TRACE_CONTENT=false, OTel GenAI message-content opt-out and available native LiveKit redaction/capture controls are respected. Private spans omit messages, arguments, outputs, schemas and exception text while keeping structural fields and valid actual usage. A parent veto applies to delayed descendants. A local recording parent created before activation has an unobserved initial policy: its child content stays hidden conservatively, even if capture is enabled later. Activate before creating local parents to enroll their initial bounds. Remote/non-recording parents retain context policy semantics. Sampling and OTel suppression skip owned payload serialization. Credential values are redacted while structural schema property names and benign URL parameters remain intact.

Owners with the same provider/settings share hooks; incompatible settings are rejected. Teardown restores only still-owned hooks/provider fields and preserves foreign replacements. In-flight owned streams finish under the retained privacy policy; reactivate after those streams close. Native values, exceptions, caller context and iterator protocols are preserved.

Declared floors are respan-tracing>=2.17.0, respan-sdk>=2.7.0 (first tested release with the required constants module), and AI semantic conventions>=0.5.1. Native LiveKit supplies the compatible OTel bounds. No unpublished companion package is required.

Coverage is bounded to native LLM streams, function utility execution and room-free Session tool tracing. Live voice rooms, realtime audio/video, remote sessions and every provider plugin are not validated by this suite. The paired Python examples use controlled SDK/HTTP fixtures by default, with explicit export and optional live OpenAI modes. Local canonical wire validation and stored trace projections are separate checks; downstream projection limitations do not change this package's span contract.

Metadata

Release files for respan-instrumentation-livekit 0.2.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 respan-instrumentation-livekit 0.2.0
File Size Uploaded Provenance Actions
respan_instrumentation_livekit-0.2.0.tar.gz 17.9 kB With provenance Details for respan_instrumentation_livekit-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for respan-instrumentation-livekit 0.2.0
File Interpreter ABI Platform Actions
respan_instrumentation_livekit-0.2.0-py3-none-any.whl Python 3 none any Details for respan_instrumentation_livekit-0.2.0-py3-none-any.whl

Total release size: 39.7 kB

Release files / respan_instrumentation_livekit-0.2.0.tar.gz

Download URL respan_instrumentation_livekit-0.2.0.tar.gz
Size 17.9 kB
Tags Source
SHA-256 checksum
How to use checksums
2a5f3e5a2c7b0f9c8adcc1e53d4d88ebe3c437b322aef632f6e84704d4ae4600
BLAKE2b-256 checksum
How to use checksums
d71fac963760811d864f1cabfd56978f4a7c23af1f71140d7cfaf20605f51f61
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 Nov 16, 2026.

Transparency log

Release files / respan_instrumentation_livekit-0.2.0-py3-none-any.whl

Download URL respan_instrumentation_livekit-0.2.0-py3-none-any.whl
Size 21.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
2dcad887f5973149932c190bee7092e597484dbe72b719391bd3a834cc978948
BLAKE2b-256 checksum
How to use checksums
27c793ee9c99c03320e857b0b819e504fb2833bafa6260bbcad9c5cf1c0e630b
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 Nov 16, 2026.

Transparency log

Security for respan-instrumentation-livekit 0.2.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

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for respan_instrumentation_livekit-0.2.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 Nov 16, 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