Overview
Portkey is an AI gateway that proxies requests to LLM providers (OpenAI, Anthropic, Google, Mistral, Cohere, Azure OpenAI, and more) with built-in caching, fallbacks, load balancing, and observability. Fiddler integrates with Portkey via its experimental “Complete Logs Export” feature, which pushes full LLM request/response logs as OTel spans to any OTLP-compatible endpoint.Portkey’s “Complete Logs Export” OTel feature is labelled experimental and is available on self-hosted / enterprise Portkey deployments only. It is not available on Portkey’s free cloud tier. This page’s tracing setup is built on that feature.
Architecture
Portkey exposes an OpenAI-compatible API. Your application calls Portkey instead of the provider directly. Portkey handles routing, caching, and fallbacks, then exports OTel spans to Fiddler for observability.Prerequisites
- Fiddler account with a GenAI application already created
- A running Portkey instance (self-hosted or enterprise — the OTel export feature is not available on the free cloud tier)
- A valid LLM provider API key configured in Portkey
- Your Fiddler API key (found under organizational settings) and application UUID (found under application settings)
Quick Start
Step 1: Configure Portkey’s OTel Export
Set the following environment variables on your Portkey deployment to enable OTel trace export to Fiddler:Step 2: Point Your Application at Portkey
No changes to your application code are needed if you already use Portkey. If you are adding Portkey for the first time:base_url and headers.
Step 3: Verify Traces Are Arriving
Open the Fiddler UI and navigate to your application’s Explorer. You should see LLM spans appearing within a few seconds of making your first LLM call through Portkey.Span Type Mapping
Fiddler classifies Portkey spans based on thegen_ai.operation.name attribute. Portkey names its spans "{operation} {model}" (e.g. "chat gpt-4o"), and the mapper reads the gen_ai.operation.name attribute to determine the span type:
Unlike Kong, Portkey emits a single span per LLM request — there is no multi-span hierarchy or infrastructure spans to filter.
Attribute Mapping
Portkey follows the OTel GenAI semantic conventions v1.40.0. Fiddler’s mapper normalizes these automatically:
Portkey uses the semconv 1.40.0 structured message format with
parts arrays (e.g. [{"role":"user","parts":[{"type":"text","content":"..."}]}]). The mapper handles both native OTLP array encoding and JSON string fallback.
Guardrails
Beyond tracing, Portkey can enforce Fiddler Guardrails on prompts and responses via the “Bring Your Own Guardrails” (BYOG) webhook. Unlike Kong (which can only block), Portkey supportstransformedData — PII and secrets can be redacted in place rather than just blocked.
See Portkey Guardrails for setup and the full configuration.
Troubleshooting
Traces not appearing in Fiddler Verify all three environment variables are set correctly on your Portkey deployment. Check thatEXPERIMENTAL_GEN_AI_OTEL_TRACES_ENABLED is true and that the endpoint URL includes /v1/traces.
The Fiddler-Application-Id header is required on the OTel export request. If missing, Fiddler skips those spans and logs a warning.
Prompt and response content not showing
Portkey includes full message content by default when the OTel export is enabled. If content is missing, check your Portkey configuration for any payload-logging restrictions.
OTel export feature not available
The “Complete Logs Export” feature is available on self-hosted and enterprise Portkey deployments only. It is not available on Portkey’s free cloud tier.
Known Limitations
Next Steps
- Portkey Guardrails — block or redact PII and secrets at the Portkey gateway.
- Kong AI Gateway Integration — add Fiddler observability through Kong.
- LiteLLM Integration — add Fiddler observability through LiteLLM.
- AgentGateway Integration — add Fiddler observability through AgentGateway.
- Portkey documentation — Portkey’s official docs.