Migrating Tracing / Observability
Portkey captures LLM traffic at its gateway and groups related requests (retries, fallbacks) into traces using atrace ID header. Netra takes a different approach: it instruments your application code directly, producing hierarchical traces with nested spans that cover complete multi-step agent workflows — not just the gateway hops.
Option A: Use the Netra SDK (Recommended)
Netra ships official SDKs for Python and TypeScript to instrument application code directly, plus native integrations across 50+ frameworks and model providers including OpenAI, LangChain, LlamaIndex, Anthropic, and more. See the full integrations overview to pick the integration that matches your stack. If you’re using the Portkey SDK (portkey-ai), the migration starts by initializing Netra before your LLM calls. You can keep Portkey’s gateway running during the transition so your existing routing and fallback logic stays intact while Netra begins capturing traces:
Option B: Use OpenTelemetry
If you already have OpenTelemetry in place — or if you were using Portkey’s OpenTelemetry integration — you don’t need to re-instrument. Point your OTLP exporter at Netra and keep your existing spans and context propagation. Configure your exporter using Netra’s OTLP endpoint:traceparent, baggage) through Portkey, those same headers work with Netra’s OpenTelemetry backend.
Option C: Replace the Gateway with LiteLLM Proxy
If you relied on Portkey primarily as an AI gateway — provider routing, fallbacks, load balancing, retries, or caching — you can replace it with LiteLLM Proxy and continue sending traces to Netra. LiteLLM supports the same gateway capabilities: fallback chains, load balancing, retries, and caching across 100+ LLM providers.Migrating Portkey-Specific Features
Portkey bundles several gateway-level features beyond basic tracing. Here’s how each maps to Netra or an alternative:Custom Metadata and Tags
Portkey lets you attach custom metadata to requests via thex-portkey-metadata header or SDK parameters for filtering and grouping in the dashboard. In Netra, you achieve the same using session attributes and decorators:
Caching, Routing, and Fallbacks
Portkey’s gateway offers simple and semantic caching, provider fallbacks, load balancing, retries, and conditional routing via Config objects. Netra focuses on observability rather than gateway routing, so for these capabilities:- LiteLLM Proxy: Supports fallbacks, load balancing, retries, and caching across 100+ providers. See Option C above.
Virtual Keys and Model Catalog
Portkey’s Virtual Keys (now Model Catalog) store provider API keys server-side so your application only needs a Portkey API key. When moving to Netra, you’ll manage provider keys directly:- Store provider API keys (OpenAI, Anthropic, etc.) in your environment variables or secrets manager.
- If using LiteLLM Proxy, configure provider keys in the LiteLLM config.
- Netra does not require or store your LLM provider credentials — it only needs its own API key for sending telemetry data.
What’s next?
Once your tracing is set up, you’re ready to explore the rest of Netra. Pick what matters most to your team:Run Simulations
Test your agents with realistic, multi-turn conversations using configurable personas and goals.
Run Evaluations
Measure quality, accuracy, and reliability with LLM-as-Judge and code evaluators.
Set Up Custom Dashboards
Build your own views to track traces, costs, and agent behavior across projects.
Configure Alerts
Get notified about anomalies, cost spikes, and performance issues.
