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

Built distribution (wheel)

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

Total release size: 49.5 kB

Release files / narrativetrace_otel-0.5.1.tar.gz

Download URL narrativetrace_otel-0.5.1.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
a62bb44f3856c7104c7f0d61f85a1c4edf57982c9b1b6c9d51ea1a4c869757d9
BLAKE2b-256 checksum
How to use checksums
86e90730c716dd35593149b00f32dd94ea9d80061b14a15ecff3fb161ae5f43a
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 30, 2026.

Transparency log

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

Download URL narrativetrace_otel-0.5.1-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aa78c4a5fad4247dac150fcc3d2ae1ea702779ea48fefad2e76be359da96ebb0
BLAKE2b-256 checksum
How to use checksums
8ef2d4ac74b1dd912356c1e21d64546d1ff15b241e1b794948bbe95bc64cad13
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 30, 2026.

Transparency log

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

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

Select from 2 files

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