Skip to main content

Middleware LLM Observability — OpenInference/Opentelemetry tracing for the Middleware SaaS

Project description

middleware-llmobs

LLM Observability for the Middleware SaaS platform, built on OpenInference and OpenTelemetry.

middleware-llmobs provides a one-line register() that configures an OpenTelemetry TracerProvider to export OpenInference traces to your Middleware collector over OTLP/HTTP.

Transport: Only HTTP/protobuf is supported. gRPC is intentionally disabled — requesting it raises NotImplementedError. (The gRPC code path is retained in the source for future use.)

Install

pip install middleware-llmobs

Quickstart

Set the standard OTLP environment variables for your Middleware account:

export OTEL_EXPORTER_OTLP_ENDPOINT="https://uid.middleware.io:443"
export OTEL_EXPORTER_OTLP_HEADERS="Authorization=<your-key>"
export OTEL_SERVICE_NAME="my-llm-app"

Then register and auto-instrument every installed OpenInference library:

from middleware.llmobs import register

providers = register(auto_instrument=True)  # batch + HTTP by default
# providers.tracer / providers.logger / providers.meter — the wired OTel providers.

Explicit configuration

from middleware.llmobs import register

providers = register(
    endpoint="https://uid.middleware.io:443",
    headers={"Authorization": "<your-key>"},
    service_name="my-llm-app",
)

Manual instrumentor wiring with GenAI semantic conventions

from middleware.llmobs import register
from openinference.instrumentation import TraceConfig
from openinference.instrumentation.openai import OpenAIInstrumentor

providers = register(service_name="my-llm-app")

OpenAIInstrumentor().instrument(
    tracer_provider=providers.tracer,
    config=TraceConfig(enable_genai_semconv=True),
)

When auto_instrument=True, register() passes TraceConfig(enable_genai_semconv=True) to each instrumentor automatically (falling back gracefully for instrumentors that don't accept a config argument).

Environment variables

Variable Purpose Example
OTEL_EXPORTER_OTLP_ENDPOINT Collector endpoint https://uid.middleware.io:443
OTEL_EXPORTER_OTLP_HEADERS Export headers (auth) Authorization=<key>
OTEL_SERVICE_NAME Service identity my-llm-app
MW_PROJECT_NAME Optional project name (defaults to service name) my-project

License

Apache-2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

middleware_llmobs-0.1.0rc2.tar.gz (33.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

middleware_llmobs-0.1.0rc2-py3-none-any.whl (31.5 kB view details)

Uploaded Python 3

File details

Details for the file middleware_llmobs-0.1.0rc2.tar.gz.

File metadata

  • Download URL: middleware_llmobs-0.1.0rc2.tar.gz
  • Upload date:
  • Size: 33.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for middleware_llmobs-0.1.0rc2.tar.gz
Algorithm Hash digest
SHA256 6d0c668e7c90572954b46ed2315f17772f598a610d521984443bca22178b5c0c
MD5 c4a765fd869a9b9324a41e8b5421d961
BLAKE2b-256 95ef224844a2aaba5851dd3e64b635d4776877548f2bfa1c773cf9630aae33c7

See more details on using hashes here.

File details

Details for the file middleware_llmobs-0.1.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for middleware_llmobs-0.1.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 2ef9a94d26bc610cca075f541424edb157318e280784a40c4a87bf62be8168f3
MD5 956a3b6abb3bd92f08a87f7b4b25fc73
BLAKE2b-256 d3d890271097cd5ec5085a5b557317113391b857f9ab99ac7e07028126d3eaa4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page