Skip to main content

narrativetrace-otel

OpenTelemetry span bridge for narrativetrace traces.

Two entry points:

  • OtelTraceEventListener — a live event consumer that opens a span on each enter and closes it on the matching exit, anchored to the event timestamps (not processing time). Orphaned spans are evicted by a bounded PerishableMap.
  • TraceSpanExporter — a batch exporter that walks a completed TraceTree/TraceNode forest and emits a nested span per node.

Matching span ids

Build your tracer provider with the helper. tracer_provider() returns a TracerProvider with NarrativeTraceIdGenerator installed; every other keyword passes through:

from narrativetrace_otel import tracer_provider

provider = tracer_provider(set_global=True)

A span's OpenTelemetry id is then its NarrativeTrace id, and a child that starts after its parent has ended parents on the real parent. The same effect without the helper is the one-liner TracerProvider(id_generator=NarrativeTraceIdGenerator()), or OTEL_PYTHON_ID_GENERATOR=narrativetrace under auto-instrumentation. An id_generator you pass yourself is kept (with one warning that ids will not mirror). Opt out with mirror_ids=False or NARRATIVETRACE_OTEL_MIRROR_IDS=false. Export each trace through one path (the live listener or TraceSpanExporter), not both.

Metadata

Release files for narrativetrace-otel 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 narrativetrace-otel 0.5.0
File Size Uploaded Provenance Actions
narrativetrace_otel-0.5.0.tar.gz 28.8 kB With provenance Details for narrativetrace_otel-0.5.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for narrativetrace-otel 0.5.0
File Interpreter ABI Platform Actions
narrativetrace_otel-0.5.0-py3-none-any.whl Python 3 none any Details for narrativetrace_otel-0.5.0-py3-none-any.whl

Total release size: 49.5 kB

Release files / narrativetrace_otel-0.5.0.tar.gz

Download URL narrativetrace_otel-0.5.0.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
08e8f8661c1a889b97ffd395188aecdeebf3a1e84191ed0e39f2987ef9940a32
BLAKE2b-256 checksum
How to use checksums
09492a043330cdd35c4f81b91e47d99e21bc0763c780e6d8edf95ea5975f4826
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 Oct 24, 2026.

Transparency log

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

Download URL narrativetrace_otel-0.5.0-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf2544831d17be7a56d8f555b43acb0080896101fe88adba4f3322895779c206
BLAKE2b-256 checksum
How to use checksums
8a5f4a037769be3330133dfacc1685431328a1c874c0408a5c62a54517edbba3
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 Oct 24, 2026.

Transparency log

Security for narrativetrace-otel 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

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

Select from 2 files

Attestation for narrativetrace_otel-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 Oct 24, 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