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

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

Built distribution (wheel)

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

Total release size: 49.5 kB

Release files / narrativetrace_otel-0.5.2.tar.gz

Download URL narrativetrace_otel-0.5.2.tar.gz
Size 28.7 kB
Tags Source
SHA-256 checksum
How to use checksums
defc48a496feaa5d29dff95d8bf0dd295df5bccdf5daf5e9aee126a8be3d7be9
BLAKE2b-256 checksum
How to use checksums
0db11116eb638c89ebd26c3fec1d9bde5057bdd2db240b4a35d06b2eb9f6ad43
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 22, 2026.

Transparency log

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

Download URL narrativetrace_otel-0.5.2-py3-none-any.whl
Size 20.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20abf5675278677abb9cc9abb4aa4d7323011718bb950aef834755664e4d4569
BLAKE2b-256 checksum
How to use checksums
40e54139f6b74a044ca0af64ba1ab5b1327af69c11934c04a5a3723fca2c87d5
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 22, 2026.

Transparency log

Security for narrativetrace-otel 0.5.2

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.2.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 22, 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