Musterby Elitery
Integrations

Kong AI Plugin

Capture Kong API Gateway AI traffic into Muster without modifying application code.

The Kong AI Tracing plugin sends traces of every AI request flowing through your Kong gateway to Muster — no application-code changes needed. Useful when many services share a single Kong gateway and you want centralized observability.

Setup

1. Install the plugin

luarocks install kong-plugin-ai-tracing

2. Configure Muster credentials on the Kong host

export LANGFUSE_PUBLIC_KEY="pk-lf-..."
export LANGFUSE_SECRET_KEY="sk-lf-..."
export LANGFUSE_BASE_URL="https://app.getmuster.io"

3. Enable the plugin on your Kong service

curl -X POST http://localhost:8001/services/YOUR_AI_SERVICE/plugins \
  -H "Content-Type: application/json" \
  -d '{
    "name": "ai-tracing",
    "config": {
      "langfuse_enabled": true,
      "langfuse_public_key": "pk-lf-...",
      "langfuse_secret_key": "sk-lf-...",
      "langfuse_endpoint": "https://app.getmuster.io/api/public/ingestion"
    }
  }'

4. Enrich traces with context headers

curl -X POST http://kong-gateway:8000/v1/chat/completions \
  -H "X-User-Id: user-12345" \
  -H "X-Session-Id: session-abc"

Headers like X-User-Id / X-Session-Id are mapped onto the trace's userId / sessionId fields.

The plugin runs async (non-blocking) and supports OpenAI-compatible APIs, vLLM, and custom providers.

See also