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

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.3
File Size Uploaded Provenance Actions
narrativetrace_otel-0.5.3.tar.gz 28.8 kB With provenance Details for narrativetrace_otel-0.5.3.tar.gz

Built distribution (wheel)

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

Total release size: 49.5 kB

Release files / narrativetrace_otel-0.5.3.tar.gz

Download URL narrativetrace_otel-0.5.3.tar.gz
Size 28.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fa4a06e03696b8669951cb0cb47b0437d3d3f748b47591bc6593889b0fd629f5
BLAKE2b-256 checksum
How to use checksums
9859769210f54492169ab52f37467ec0936513ebf6e77fb1a58622148b890f02
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 25, 2026.

Transparency log

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

Download URL narrativetrace_otel-0.5.3-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a1d469219c3e953c19bb77299db149b06056e07ba29a59fec177ca983e699a8c
BLAKE2b-256 checksum
How to use checksums
d75f99c72133842c5bc266817e515a5086dd5cdb3cc51b4be98164d192742010
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 25, 2026.

Transparency log

Security for narrativetrace-otel 0.5.3

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.3.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 25, 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