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: E1 — offline only. No real measurement has been taken with this package: the window that built it had no NeoMundi service verification key. The suite drives the real
openaiclient, 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
withblock 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
Not on PyPI yet — pip install otel-neomundi does not work. Install from
the repository:
pip install 'git+https://github.com/neomundi-io/neomundi-integrations.git#subdirectory=integrations/otel'
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 | none — E1. 0 observations submitted, 0 re-read. qualify.py ready; dry run green against a scripted endpoint |
| Maturity | experimental |
Read LIMITATIONS.md before drawing a conclusion from any score.
License
Apache-2.0. See LICENSE.
Metadata
Release files for otel-neomundi 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| otel_neomundi-0.1.0.tar.gz | 22.1 kB | With provenance | Details for otel_neomundi-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| otel_neomundi-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for otel_neomundi-0.1.0-py3-none-any.whl |
Total release size: 35.6 kB
Release files / otel_neomundi-0.1.0.tar.gz
| Download URL | otel_neomundi-0.1.0.tar.gz |
|---|---|
| Size | 22.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
4a26feaa8a6bf37d4586a1c86f743ca56efb389e3178e122a0f4267d6b6a04d6
|
|
BLAKE2b-256 checksum How to use checksums |
a46b30f86a1c08c02ac7bbc7afb7c22c78d7aa74b3b5f00a7616e73327ce0c47
|
| 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 26, 2026.
Transparency logRelease files / otel_neomundi-0.1.0-py3-none-any.whl
| Download URL | otel_neomundi-0.1.0-py3-none-any.whl |
|---|---|
| Size | 13.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4166e7056e389507f293b15df78e25507c94974597327958448f4b0a67a48879
|
|
BLAKE2b-256 checksum How to use checksums |
1697145e6db17c3d8c9b8827a839fb1c0139fa949e982629ab5507705b7756d0
|
| 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 26, 2026.
Transparency logSecurity for otel-neomundi 0.1.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.
Attestation for otel_neomundi-0.1.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 26, 2026.
Transparency logA 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.