Available via: Kong’s OpenTelemetry plugin (any language calling through the gateway). This is not a Zespan SDK wrapper — see Send traces from any OTel-instrumented app for how the underlying endpoint works.
Setup
Enable theopentelemetry plugin on your AI Gateway route (declarative config shown; the same fields apply via the Admin API or kubectl/Konnect):
zespan.gateway: kong tells Zespan the spans come from Kong; without it, a custom service.name such as the one above means Kong’s AI spans are stored as plain OpenTelemetry (see AI gateways).
What gets captured
Kong AI Gateway’s LLM-specific spans carry GenAI semantic-convention attributes — model, provider, token usage — the same fields Zespan reads from any OTel source. Kong does not put cost on its spans (it reports cost as metrics), so Zespan prices each call from the model and token counts. Kong’s own core spans (router, balancer and similar) are exported in the same request and, once the source is recognised as Kong, are stored asgateway spans of the trace, without a model; they are not counted as model calls. Every request proxied through the gateway is traced regardless of the calling app’s language or framework, which is the main reason to route through a gateway in the first place. Prompt and completion text is stored only if Kong exports it and your project’s prompt storage setting allows it.
Attribute names come from Kong’s published documentation and can change between versions. Use the Gateway and OTLP data card to see what actually arrives. Check your plugin version’s fields for how to set custom headers.
Verify
Send one request through Kong, then open Settings → Instrumentation → Gateway and OTLP data and press Refresh. See Instrumentation.Using the SDK too
If an app also uses the Zespan SDK for the same call, Zespan can count its tokens and cost once when merging is on (see the linked section) and Kong’s spans are recognised as Kong’s (keepzespan.gateway: kong from the setup above). Kong’s plugin can extract and inject W3C trace context (config.propagation), and its AI spans carry gen_ai.response.id, so the trace link (turn on gatewayCorrelation for your gateway’s host) and the response id can both match.
Next steps
- OTel integration, the endpoint, limits and attributes Zespan reads
- Instrumentation, check what arrived
- LiteLLM Proxy, Portkey, other gateways

