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.0rc5.tar.gz (35.9 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.0rc5-py3-none-any.whl (33.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: middleware_llmobs-0.1.0rc5.tar.gz
  • Upload date:
  • Size: 35.9 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.0rc5.tar.gz
Algorithm Hash digest
SHA256 ca5c32d96afa7a49f6a751c118145de4102a2769ac97990f90cb276e9e1cc5de
MD5 5be3dc623c0a817abd554ac14fef98de
BLAKE2b-256 893e9e966589af3ff3e3084a02ac6fe1cca917744e6300851272179560d97f9f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for middleware_llmobs-0.1.0rc5-py3-none-any.whl
Algorithm Hash digest
SHA256 3fea6dd27abaa61a3f843d3ff1c2d4f98586cd6cf87f60b03ff3ccd4c1cfc3e7
MD5 e257e1bc8092278009176d7245b5676f
BLAKE2b-256 ec8d98019b1ed22930e3b6b37e896e4d29d87332224d9a3bdc834f0db665dfbf

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