Skip to main content

Overview

AgentGateway (v1.1.0+, Apache 2.0) is an open-source Rust proxy that sits between your application and its LLM provider. Fiddler integrates with AgentGateway at the proxy layer, giving you full LLM observability — prompts, responses, token usage, latency — without adding any SDK to your application code.

Architecture

AgentGateway exposes an OpenAI-compatible API (/v1/chat/completions). Your application requires no SDK — it just calls the proxy instead of the provider directly.

Prerequisites

  • Fiddler account with a GenAI application already created
  • AgentGateway v1.1.0 or later
  • A valid LLM provider API key (e.g. OPENAI_API_KEY)
  • Your Fiddler API key (found under organizational settings) and application UUID (found under application settings)

Quick Start

Step 1 — Install AgentGateway

Step 2 — Configure AgentGateway

Create agentgateway_config.yaml:
The frontendPolicies.tracing block captures prompt and response content via CEL expressions and exports spans directly to Fiddler over HTTPS. $FIDDLER_API_KEY and $FIDDLER_APP_ID are expanded from environment variables at runtime — no credentials are hardcoded in the config file.

Step 3 — Start AgentGateway

Step 4 — Point your application at AgentGateway

Traces appear in Fiddler automatically — no SDK import, no callback registration, no changes to your application logic. To override the default proxy URL, set AGENTGATEWAY_URL (defaults to http://localhost:4000/v1):

Step 5 — Verify traces are arriving

Open the Fiddler UI and navigate to your application’s Explorer. You should see the trace within a few seconds of making your first completion call.

Span Type Mapping

Fiddler classifies AgentGateway spans based on gen_ai.operation.name, which AgentGateway sets automatically on every LLM proxy call: Fiddler’s AgentGateway mapper checks this attribute and sets fiddler.span.type = "llm" internally — no CEL config is required for classification. The fiddler.span.type: '"llm"' line in the CEL config above is a safety net for Fiddler deployments that process spans without the dedicated mapper.

Attribute Mapping

AgentGateway uses slightly different attribute names from the OpenTelemetry GenAI semantic conventions. Fiddler’s mapper normalizes these automatically: Content attributes (gen_ai.llm.input.user, gen_ai.llm.input.system, gen_ai.llm.output) are set by the CEL config in AgentGateway — no JSON parsing is required by the mapper.

Session Grouping

Fiddler groups all LLM calls that share the same gen_ai.conversation.id into a single Session. The recommended pattern is to generate one UUID per logical conversation in your application and pass it on every LLM call as the X-Fiddler-Conversation-Id HTTP header. The CEL expression in the AgentGateway config (see Step 2) extracts the header and stamps it as the span attribute. The header transport is preferred over OpenAI’s metadata request body field because:
  • OpenAI’s metadata parameter requires store=true, which persists conversation data on OpenAI’s side — a privacy concern for many customers.
  • AgentGateway is a passthrough proxy: anything in the request body must be a valid OpenAI parameter or the request fails.
  • Headers are visible to AgentGateway and silently stripped by OpenAI.

Troubleshooting

Traces not appearing in Fiddler Verify all three environment variables are set before starting AgentGateway:
Both application.id (OTel resource attribute) and fiddler-application-id (HTTP header on the export request) are required. If either is missing or does not match a valid Fiddler application UUID, spans are silently dropped. Prompt and response content not showing The frontendPolicies.tracing.attributes CEL block is required. Verify it is present in agentgateway_config.yaml and that AgentGateway is v1.1.0+:
Span type showing as Unknown Fiddler classifies spans using gen_ai.operation.name (set automatically by AgentGateway). Verify that AgentGateway is v1.1.0+ and that the frontendPolicies.tracing.attributes block is present in your config. As a fallback, ensure fiddler.span.type: '"llm"' is included in the attributes block — this covers Fiddler deployments that process spans without the dedicated AgentGateway mapper. Not all LLM calls are producing traces randomSampling: true is active. Set it to false to capture every span:

Known Limitations