Skip to main content

English · Français

OpenTelemetry × NeoMundi

Measure the model calls your application already traces — one span processor next to your exporters, the latency your trace already observed, and the NeoMundi request_id written back into the same trace.

Quickstart · What it refuses to do · Notebook · Limitations · Cost


Evidence level: E2 — measured against production. Four real observations on 2026-11-26, each re-read from the API as persisted, served measurement_version 3.5.0. Two further phases were refused on real spans and billed nothing. Earlier text said E1; that was true until the qualification ran. The window that built it had no NeoMundi service verification key. The suite drives the real openai client, the real contrib openai-v2 instrumentation and the real OpenTelemetry SDK through mock transports. See LIMITATIONS.md §9.

What this is

NeoMundiSpanProcessor is an OpenTelemetry SpanProcessor. You add it to the tracer provider your application already uses. Around a model call you want measured, you open an interaction and declare the token count your provider returned; the processor finds the GenAI span your instrumentation produced inside it, takes its latency, model and trace identity, and submits to NeoMundi's POST /v1/govern through the neomundi SDK. The request_id is then set on a neomundi.interaction span in the same trace, which your exporter ships to your backend.

What it is not

  • Not a way to measure spans on their own. A span's gen_ai.usage.* is written by an instrumentation, and we measured one that replaces the provider's count with an estimate while the span looks the same. A span's count is never submitted (LIMITATIONS §1).
  • Not zero-touch. One with block per measured call, to declare the count.
  • Not an instrumentation. It reads the GenAI span of whichever instrumentation you run; it installs none.
  • Not a tracer, evaluator or truth checker. Every submission is a billed measurement; NeoMundi verifies integrity and authenticity, not whether an answer was true.

Install

pip install otel-neomundi

Python ≥ 3.11. Depends on opentelemetry-sdk>=1.45.2,<2.0 and neomundi>=2.1.0,<3.0. If you use the contrib openai-v2 instrumentation, pin opentelemetry-util-genai>=1.1b0,<1.2 — the latest release breaks its import (LIMITATIONS §6).

Quickstart

processor = NeoMundiSpanProcessor(
    api_key=..., base_url="https://api.neomundi.io", tracer_provider=tracer_provider
)
tracer_provider.add_span_processor(processor)  # next to your exporters

with processor.interaction() as interaction:
    reply = client.chat.completions.create(model=..., messages=...)
    # The count the PROVIDER returned -- or None if it returned none.
    interaction.declare(token_count=reply.usage.total_tokens if reply.usage else None)

print(interaction.outcome.status, interaction.outcome.request_id)

Free first: NeoMundiSpanProcessor(submit=False, tracer_provider=...) needs no key, opens no socket, and tells you which of your calls would be measured. Runnable, offline: examples/01_offline_interaction.py and the notebook.

Refusals

Every interaction ends with an Outcome and an explicit status. Nothing is submitted, and nothing is billed, when:

Status Why
not_submitted_no_token_count nothing declared — even if the span carries gen_ai.usage.*
not_submitted_invalid_token_count the declared count is not a positive integer
not_submitted_no_genai_span no GenAI span inside the interaction, or the processor is on another provider
not_submitted_ambiguous_spans several GenAI spans: which call is meant is not guessed
not_submitted_unsupported_operation not chat / text completion / generate content, or no operation name
not_submitted_application_error your block raised (re-raised unchanged), or the span status is ERROR
not_submitted_no_latency the span has no usable start and end
skipped_sampling / not_submitted_local_only sample_rate excluded it / submit=False
not_submitted_transport_error the API was unreachable — your call was not affected

No exception from this package reaches your application. Outcomes carry no prompt, response or key — only lengths and identifiers. examples/02_refusals.py shows each one on a real span.

What it costs

🔴 Every submitted observation is a billed measurement (0.030 CHF on TIER_03). A span alone is never billed; only an interaction with a declared count. sample_rate (default 1.0) is deterministic in the trace id. Kill switch: processor.sample_rate = 0.0, immediate.

Honest status

Offline test suite 48 tests, green on Python 3.12 / Linux locally; CI runs 3.11–3.13 on Linux, macOS, Windows
Real execution E2 — 4 observations submitted against production, 4 re-read as persisted, measurement_version 3.5.0, 0.12 CHF (2026-11-26)
Maturity beta

Read LIMITATIONS.md before drawing a conclusion from any score.

License

Apache-2.0. See LICENSE.

Metadata

Release files for otel-neomundi 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 otel-neomundi 0.2.0
File Size Uploaded Provenance Actions
otel_neomundi-0.2.0.tar.gz 33.7 kB With provenance Details for otel_neomundi-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for otel-neomundi 0.2.0
File Interpreter ABI Platform Actions
otel_neomundi-0.2.0-py3-none-any.whl Python 3 none any Details for otel_neomundi-0.2.0-py3-none-any.whl

Total release size: 52.1 kB

Release files / otel_neomundi-0.2.0.tar.gz

Download URL otel_neomundi-0.2.0.tar.gz
Size 33.7 kB
Tags Source
SHA-256 checksum
How to use checksums
22962f271421cb1c31e561f60eb6fe3ef736cf054b6b65379efc833d872859cd
BLAKE2b-256 checksum
How to use checksums
3affa4d0e193c7ee607a443f27f1031055411876b3b174e5d4ac00cff809246f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

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

Download URL otel_neomundi-0.2.0-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
edd2b6ab0924828a1709955cc03cec816c2e38da47aa35ca03648c9c038b8f88
BLAKE2b-256 checksum
How to use checksums
8f20bf707769cb2ec516d5cf99ebea12ffcf7ae575d8a60d763a4a7894d7ddfd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 28, 2026.

Transparency log

Security for otel-neomundi 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 otel_neomundi-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 28, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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