openinference-instrumentation-portkey
OpenInference Portkey AI Instrumentation
What it is and what it does
This package adds automatic tracing to Portkey AI library calls by wrapping them with OpenTelemetry instrumentation. It captures request and response data—input messages, output messages, and model information—and exports them as OpenTelemetry spans, enabling you to integrate Portkey calls into distributed tracing systems and observability platforms.
You install it alongside opentelemetry-api and opentelemetry-instrumentation, then call PortkeyInstrumentor().instrument() to activate tracing for all subsequent Portkey AI operations. It's designed for developers building LLM applications who need visibility into API call behavior across distributed systems.
Use it for:
- Monitor Portkey AI API latency and error rates in production using OpenTelemetry exporters (Jaeger, Datadog, etc.)
- Debug LLM application behavior by inspecting captured input/output messages in trace spans
- Correlate Portkey AI calls with other service traces in a microservices architecture
- Audit and log all Portkey AI interactions for compliance or troubleshooting
- Identify performance bottlenecks in LLM request/response cycles
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Automatically instruments Portkey AI API calls with OpenTelemetry tracing, capturing input/output messages and model metadata for distributed tracing and observability.
Yes, if you use Portkey AI and need observability. The package is actively maintained, has no known vulnerabilities, carries a permissive license, and integrates cleanly with OpenTelemetry. Install it when you're ready to add distributed tracing to Portkey calls; it requires Python 3.10+ and the opentelemetry-api stack.
Install
openinference-instrumentation-portkey on PyPI
pip
pip install openinference-instrumentation-portkeyuv
uv add openinference-instrumentation-portkeypoetry
poetry add openinference-instrumentation-portkeyInstalling openinference-instrumentation-portkey
Before you install
Low install friction with a pure-Python wheel. Active maintenance with a recent release (2 days old) and steady repository activity. Supports Python 3.10 through 3.14.
License in practice
Apache-2.0 is permissive; you can use this package freely in commercial and private projects without requiring source disclosure.
Quickstart
pip install openinference-instrumentation-portkey
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleSpanProcessor, ConsoleSpanExporter
from openinference.instrumentation.portkey import PortkeyInstrumentor
trace.set_tracer_provider(TracerProvider())
trace.get_tracer_provider().add_span_processor(
SimpleSpanProcessor(ConsoleSpanExporter())
)
PortkeyInstrumentor().instrument()
Requires Python 3.10 or later and Portkey AI 0.1.0 or later to be installed separately.
Verify before relying
- Whether Portkey AI 0.1.0+ is actually required or if earlier versions work
- Performance overhead of instrumentation on high-volume Portkey API calls
- Compatibility with specific Portkey AI versions beyond the stated 0.1.0+ requirement
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (<3.15,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — openinference-instrumentation, openinference-semantic-conventions, opentelemetry-api, opentelemetry-instrumentation, opentelemetry-semantic-conventions, typing-extensions, wrapt |
| Maintenance | actively maintained — 2 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 95,715/month — #13,253 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: openinference_instrumentation_portkey-0.1.13-py3-none-any.whl
Tags
More Monitoring packages
Wraps any iterable to display a real-time…
copyleft · top 100 on PyPI
opentelemetry-semantic-conventionsProvides generated Python code for…
permissive · top 100 on PyPI
opentelemetry-sdkProvides the reference implementation of the…
permissive · top 100 on PyPI
opentelemetry-apiProvides the abstract API and interfaces for…
permissive · top 100 on PyPI
opentelemetry-exporter-otlp-proto-httpExports OpenTelemetry observability data to an…
permissive · top 1,000 on PyPI
opentelemetry-instrumentationProvides automatic instrumentation commands and…
permissive · top 1,000 on PyPI
openinference-instrumentation-openaiAuto-instruments OpenAI Python SDK calls to…
permissive · top 5,000 on PyPI
portkey-aiPortkey is a Python SDK that wraps…
permissive · top 5,000 on PyPI
openinference-instrumentationProvides utility functions to convert typed…
permissive · top 5,000 on PyPI
literalaiLiteralai is a Python SDK for observability in…
permissive · top 15,000 on PyPI
openinference-instrumentation-openai-agentsAuto-instruments OpenAI Agents SDK to emit…
permissive · top 5,000 on PyPI
openinference-instrumentation-google-genaiAutomatically instruments Google GenAI SDK…
permissive · top 15,000 on PyPI
openinference-instrumentation-google-adkAuto-instruments Google ADK applications to…
permissive · top 15,000 on PyPI
opentelemetry-instrumentation-openai-v2Automatically traces and logs OpenAI API calls…
permissive · top 5,000 on PyPI
opentelemetry-instrumentation-aiokafkaAdds distributed tracing instrumentation to…
permissive · top 5,000 on PyPI
openinference-instrumentation-agnoAuto-instruments Agno Agent applications to…
permissive · top 15,000 on PyPI