Skip to content
Help guide the future of agentgateway — Take the survey

Metrics reference

Page as Markdown

Review the metrics that are available in agentgateway.

Note

All counter and histogram metrics only appear in the output after the first request of that type. For example, agentgateway_mcp_requests_total is not present until MCP traffic is received. This is normal Prometheus behavior. Counters and histograms are not pre-initialized.

Data plane metrics

The XDS metrics track communication with an XDS management server. Agentgateway registers them only in Kubernetes mode against a control plane, so they do not appear on the metrics endpoint of a standalone process.

The LLM metrics follow the OpenTelemetry semantic conventions for generative AI.

XDS

MetricTypeUnitDescription
agentgateway_xds_connection_terminations_totalCounter—The total number of completed connections to xds server (unstable).
agentgateway_xds_message_bytes_totalCounterbytesTotal number of bytes received (unstable).
agentgateway_xds_message_totalCounter—Total number of messages received (unstable).

HTTP

MetricTypeUnitDescription
agentgateway_request_duration_secondsHistogramsecondsDuration of HTTP requests (seconds).
agentgateway_request_processing_secondsHistogramsecondsDuration from receiving an HTTP request to sending the primary outbound call (seconds).
agentgateway_requests_activeGauge—Number of HTTP requests to a backend currently awaiting a complete response.
agentgateway_requests_shed_totalCounter—Total downstream requests rejected by the in-flight request limit.
agentgateway_requests_totalCounter—The total number of HTTP requests sent.
agentgateway_response_bytes_totalCounterbytesTotal HTTP response bytes received.
agentgateway_response_processing_secondsHistogramsecondsDuration from receiving the primary outbound response to sending the HTTP response (seconds).
agentgateway_retries_totalCounter—The total number of request retries.

TCP

MetricTypeUnitDescription
agentgateway_downstream_connections_shed_totalCounter—Total downstream connections closed by the active connection limit.
agentgateway_downstream_connections_totalCounter—The total number of downstream connections established.
agentgateway_downstream_received_bytes_totalCounterbytesTotal TCP bytes received per connection labels.
agentgateway_downstream_sent_bytes_totalCounterbytesTotal TCP bytes transmitted per connection labels.
agentgateway_tls_handshake_duration_secondsHistogramsecondsDuration to complete inbound TLS/HTTPS handshake (seconds).
agentgateway_upstream_connect_duration_secondsHistogramsecondsDuration to establish upstream connection (seconds).

MCP

MetricTypeUnitDescription
agentgateway_mcp_requests_totalCounter—Total number of MCP requests.

LLM

MetricTypeUnitDescription
agentgateway_cost_catalog_lookups_totalCounter—Total number of model cost catalog lookups by resolution status.
agentgateway_gen_ai_client_cost_usd_totalCounterusdCumulative USD cost of generative AI requests.
agentgateway_gen_ai_client_token_usageHistogram—Number of tokens used per request.
agentgateway_gen_ai_server_inter_chunk_latencyHistogram—Time between consecutive output chunks for a given request.
agentgateway_gen_ai_server_request_durationHistogram—Duration of a generative AI request in seconds; failed operations have error_type="_OTHER" and successful operations omit the label.
agentgateway_gen_ai_server_time_per_output_tokenHistogram—Time to generate each output token for a given request.
agentgateway_gen_ai_server_time_to_first_tokenHistogram—Time to generate the first token for a given request.
agentgateway_guardrail_checks_totalCounter—Total number of guardrail checks.

Misc

MetricTypeUnitDescription
agentgateway_atenet_router_route_duration_secondsHistogramsecondsTime from receiving a Substrate request to resolving its worker endpoint.
agentgateway_build_infoInfo—Agentgateway build information.
agentgateway_config_synchronizedGauge—Whether the last configuration load/reload was successful or not, being synchronized with the on-disk configuration.
agentgateway_substrate_request_parking_activeGauge—Number of requests waiting for a Substrate actor to become routable.
agentgateway_upstream_call_duration_secondsHistogramsecondsDuration of outbound calls made by agentgateway (seconds).
agentgateway_upstream_connections_activeGauge—Number of currently open upstream connections.

MCP request outcomes

The outcome label of the agentgateway_mcp_requests_total metric has one of the following values. Agentgateway checks the conditions in order and uses the first value that matches. For example, a response with a 5xx HTTP status that also carries a JSON-RPC error is counted as gateway_error, not protocol_error.

  1. gateway_error: Agentgateway returned an error for the request, or the response has a 4xx or 5xx HTTP status.
  2. protocol_error: The response is a JSON-RPC error.
  3. tool_error: The request is a tools/call request, and the tool result sets isError: true.
  4. success: The request is a tools/call request with a tool result that does not set isError: true, or the request uses any other method and the response has a 2xx HTTP status.
  5. unknown: The request does not match any of the previous conditions. For example, a tools/call request that has no tool result is counted as unknown, even if the response has a 2xx HTTP status.

Runtime and process metrics

Async runtime

These metrics reflect the async runtime of the agentgateway process. They appear on every startup, regardless of traffic.

MetricTypeUnitDescription
agentgateway_tokio_num_workersGauge—The number of worker threads the async runtime uses.
agentgateway_tokio_num_alive_tasksGauge—The number of tasks currently alive in the async runtime.
agentgateway_tokio_global_queue_depthGauge—The number of tasks currently scheduled in the async runtime’s global queue.

Cgroup memory

These metrics track Linux cgroup v2 memory statistics for the agentgateway process. They are available whenever agentgateway runs in a Linux environment, including standalone deployments, and are not specific to Kubernetes mode.

MetricTypeUnitDescription
agentgateway_cgroup_usageGaugebytesCurrent memory usage.
agentgateway_cgroup_working_setGaugebytesCurrent working set.
agentgateway_cgroup_anonGaugebytesCurrent anonymous memory usage.
agentgateway_cgroup_active_anonGaugebytesCurrent active anonymous memory usage.
agentgateway_cgroup_inactive_anonGaugebytesCurrent inactive anonymous memory usage.
agentgateway_cgroup_fileGaugebytesCurrent file memory usage.
agentgateway_cgroup_file_mappedGaugebytesCurrent mapped file memory usage.
agentgateway_cgroup_active_fileGaugebytesCurrent active file memory usage.
agentgateway_cgroup_inactive_fileGaugebytesCurrent inactive file memory usage.
agentgateway_cgroup_shmemGaugebytesCurrent shared memory usage.
agentgateway_cgroup_kernelGaugebytesCurrent kernel memory usage.
agentgateway_cgroup_kernel_stackGaugebytesCurrent kernel stack memory usage.
agentgateway_cgroup_pagetablesGaugebytesCurrent page tables memory usage.
agentgateway_cgroup_percpuGaugebytesCurrent per-CPU memory usage.
agentgateway_cgroup_sockGaugebytesCurrent socket memory usage.
agentgateway_cgroup_slabGaugebytesCurrent slab memory usage.
agentgateway_cgroup_slab_reclaimableGaugebytesCurrent reclaimable slab memory usage.
agentgateway_cgroup_slab_unreclaimableGaugebytesCurrent unreclaimable slab memory usage.
agentgateway_cgroup_pgfault_totalCounter—Total cgroup page faults.
agentgateway_cgroup_pgmajfault_totalCounter—Total cgroup major page faults.
agentgateway_cgroup_workingset_refault_anon_totalCounter—Total anonymous working set refaults.
agentgateway_cgroup_workingset_refault_file_totalCounter—Total file working set refaults.
agentgateway_cgroup_workingset_activate_anon_totalCounter—Total anonymous working set activations.
agentgateway_cgroup_workingset_activate_file_totalCounter—Total file working set activations.
agentgateway_cgroup_workingset_restore_anon_totalCounter—Total anonymous working set restores.
agentgateway_cgroup_workingset_restore_file_totalCounter—Total file working set restores.

Process memory

These metrics track process-level memory for the agentgateway process, sourced from /proc/self/smaps. They are available whenever agentgateway runs in a Linux environment, including standalone deployments, and are not specific to Kubernetes mode.

MetricTypeUnitDescription
agentgateway_process_sizeGaugebytesTotal virtual memory size of the process.
agentgateway_process_rssGaugebytesRSS (resident set size) memory usage.
agentgateway_process_pssGaugebytesPSS (proportional set size) memory usage.
agentgateway_process_pss_dirtyGaugebytesDirty PSS memory usage.
agentgateway_process_shared_cleanGaugebytesShared clean memory usage.
agentgateway_process_shared_dirtyGaugebytesShared dirty memory usage.
agentgateway_process_private_cleanGaugebytesPrivate clean memory usage.
agentgateway_process_private_dirtyGaugebytesPrivate dirty memory usage.
agentgateway_process_referencedGaugebytesReferenced memory usage.
agentgateway_process_anonymousGaugebytesAnonymous memory usage.
agentgateway_process_lazy_freeGaugebytesLazy free memory.
agentgateway_process_anon_huge_pagesGaugebytesAnonymous huge pages usage.
agentgateway_process_shmem_huge_pagesGaugebytesShared memory huge pages usage.
agentgateway_process_shmem_pmd_mappedGaugebytesShared memory PMD-mapped usage.
agentgateway_process_file_pmd_mappedGaugebytesFile PMD-mapped usage.
agentgateway_process_shared_hugetlbGaugebytesShared hugetlb usage.
agentgateway_process_private_hugetlbGaugebytesPrivate hugetlb usage.
agentgateway_process_swapGaugebytesProcess swap usage.
agentgateway_process_swap_pssGaugebytesProcess proportional swap usage.
agentgateway_process_lockedGaugebytesProcess locked memory usage.
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/.