Skip to content
agentgateway has joined the Agentic AI FoundationLearn more

For the complete documentation index, see llms.txt. Markdown versions of all docs pages are available by appending .md to any docs URL.

Page as Markdown

Cost dashboard

View LLM spend, tokens, and traffic in the built-in Admin UI when running agentgateway on Kubernetes.

The built-in Admin UI includes a cost dashboard: the same LLM > Analytics page available in standalone mode. It plots spend, tokens, and calls over time, broken down by model, provider, user, group, or user agent. It works in Kubernetes too, but unlike standalone it is not enabled by default. The proxy ships without a request-log database, so the dashboard has nothing to show until you configure one.

Requirements

Two pieces of configuration power the dashboard:

  • A request-log database (config.database). The Kubernetes AgentgatewayParameters resource has no typed field for it, so you set it through rawConfig, which merges raw agentgateway configuration into the proxy’s config file. Point it at a writable path in the pod, such as the /tmp volume.
  • A model cost catalog (spec.modelCatalog) so requests are priced. Without a catalog, the dashboard still shows token and call volume, but the cost is 0.
The /tmp path is an ephemeral emptyDir, so the request-log history is per-pod and is lost when the pod restarts or scales. For durable history, back config.database with a persistent volume, and note that each replica keeps its own local database.

Enable the dashboard

  1. Create (or update) a Gateway-level AgentgatewayParameters resource that enables the database through rawConfig and attaches a model catalog. The catalog configMap must already exist in the Gateway’s namespace (see Model costs).

    kubectl apply -f- <<EOF
    apiVersion: agentgateway.dev/v1alpha1
    kind: AgentgatewayParameters
    metadata:
      name: cost-dashboard-params
      namespace: agentgateway-system
    spec:
      modelCatalog:
        sources:
          - configMap:
              name: my-model-costs
              key: catalog.json
      rawConfig:
        config:
          database:
            url: "sqlite:////tmp/data.db?mode=rwc"
    EOF
  2. Attach the AgentgatewayParameters resource to your Gateway with infrastructure.parametersRef. modelCatalog and rawConfig are honored only on a Gateway-level resource.

    kubectl apply -f- <<EOF
    apiVersion: gateway.networking.k8s.io/v1
    kind: Gateway
    metadata:
      name: agentgateway-proxy
      namespace: agentgateway-system
    spec:
      gatewayClassName: agentgateway
      infrastructure:
        parametersRef:
          name: cost-dashboard-params
          group: agentgateway.dev
          kind: AgentgatewayParameters
      listeners:
        - name: http
          port: 80
          protocol: HTTP
          allowedRoutes:
            namespaces:
              from: All
    EOF
  3. Wait for the proxy to roll out with the new configuration.

    kubectl rollout status deployment/agentgateway-proxy -n agentgateway-system

Open the dashboard

Every request that flows through the proxy is now recorded and priced. Port-forward the proxy’s Admin UI and open the Analytics page.

  1. Port-forward the Admin UI port.

    kubectl port-forward deployment/agentgateway-proxy -n agentgateway-system 15000
  2. Open http://localhost:15000/ui/llm/analytics. Send some LLM traffic through the gateway, then refresh to see traffic over time with a running tally of cost, tokens, and calls, plus a breakdown below the chart.

    agentgateway Analytics cost dashboard in the Kubernetes Admin UI
    agentgateway Analytics cost dashboard in the Kubernetes Admin UI

In Kubernetes (xds) mode the Admin UI is read-only. You view the dashboard, but you manage configuration through Kubernetes resources rather than the UI.

Group by and measure

Use the Group by control to break the same traffic down by model, provider, user, group, or user agent*, and toggle Measure between tokens, cost, and requests. Set to Cost to see realized spend in dollars. Use Export to pull the underlying numbers out for reporting.

Was this page helpful?
Agentgateway assistant

Ask me anything about agentgateway configuration, features, or usage.

Note: AI-generated content might contain errors; please verify and test all returned information.

Tip: one topic per conversation gives the best results. Use the + button in the chat header to start a new conversation.

Switching topics? Starting a new conversation improves accuracy.
↑↓ navigate select esc dismiss

What could be improved?

Your feedback helps us improve assistant answers and identify docs gaps we should fix.

Need more help? Join us on Discord: https://discord.gg/y9efgEmppm

Want to use your own agent? Add the Solo MCP server to query our docs directly. Get started here: https://search.solo.io/.