Skip to content

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

Prometheus

Collect metrics from agentgateway with Prometheus

Agentgateway exposes Prometheus-compatible metrics for monitoring and alerting.

Metrics endpoint

Agentgateway exposes metrics on port 15020 by default:

curl http://localhost:15020/metrics

Available metrics

Request metrics

MetricTypeDescription
agentgateway_requests_totalCounterTotal number of requests
agentgateway_request_duration_secondsHistogramRequest duration
agentgateway_request_size_bytesHistogramRequest size
agentgateway_response_size_bytesHistogramResponse size

Connection metrics

MetricTypeDescription
agentgateway_connections_activeGaugeActive connections
agentgateway_connections_totalCounterTotal connections

MCP metrics

MetricTypeDescription
agentgateway_mcp_sessions_activeGaugeActive MCP sessions
agentgateway_mcp_requests_totalCounterTotal MCP requests by method

LLM metrics

MetricTypeDescription
agentgateway_llm_requests_totalCounterTotal LLM requests
agentgateway_llm_tokens_totalCounterTotal tokens (input/output)
agentgateway_llm_request_duration_secondsHistogramLLM request duration

Prometheus configuration

Add agentgateway to your Prometheus configuration:

# prometheus.yml
scrape_configs:
  - job_name: 'agentgateway'
    static_configs:
      - targets: ['localhost:15020']
    scrape_interval: 15s

Docker Compose example

version: '3'
services:
  agentgateway:
    image: ghcr.io/agentgateway/agentgateway:latest
    ports:
      - "3000:3000"
      - "15020:15020"
    volumes:
      - ./config.yaml:/etc/agentgateway/config.yaml

  prometheus:
    image: prom/prometheus:latest
    ports:
      - "9090:9090"
    volumes:
      - ./prometheus.yml:/etc/prometheus/prometheus.yml
    command:
      - '--config.file=/etc/prometheus/prometheus.yml'

Kubernetes ServiceMonitor

For Kubernetes deployments with Prometheus Operator:

apiVersion: monitoring.coreos.com/v1
kind: ServiceMonitor
metadata:
  name: agentgateway
spec:
  selector:
    matchLabels:
      app: agentgateway
  endpoints:
  - port: metrics
    interval: 15s
    path: /metrics

Learn more

Grafana

Visualize metrics with Grafana

Telemetry Tutorial

Step-by-step observability setup

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/.