# Metrics reference

> Field-level reference for the ConnectionMetric record emitted by the Agent Gateway for every surface request.
The Agent Gateway records a ConnectionMetric entry for every request processed by a surface. These records drive the built-in dashboard, the Monitoring tab on each surface, and the OTLP metrics export.

## Core fields

Present on every metric record, regardless of metric type.

| Field | Type | Description |
| timestamp | datetime (UTC) | When the request was processed. |
| channel_config_id | string | Identifier of the surface configuration that processed the request. |
| source | string | Source address or agent identifier. For surface requests, typically the caller’s IP address. |
| destination | string | Upstream target address the gateway forwarded the request to. |
| status | string | Request outcome. See [Status values](#status-values). |
| latency_ms | integer (optional) | Total end-to-end latency in milliseconds, from request received to response sent. |
| identity_hash | string (optional) | Hash of the agent identity (DID) associated with this request. Present when Identity Management is enabled and a DID was derived. |
| direction | string | Whether this record captures a request or response event. See [Direction values](#direction-values). |
| trace_id | string | W3C-compatible trace identifier. Links this metric to the corresponding distributed trace span. |
| metric_type | string | Record classification. See [Metric type values](#metric-type-values). |
| correlation_id | string (optional) | Caller-provided correlation identifier propagated from the inbound request. |
| agent_identity | string (optional) | Resolved agent DID string, when available. Distinct from identity_hash in that it holds the full DID. |
| request_bytes | integer (optional) | Size of the inbound request body in bytes. |
| response_bytes | integer (optional) | Size of the outbound response body in bytes. |
| retry_count | integer (optional) | Number of retries the gateway performed before the request succeeded or was abandoned. Present when retry is configured and at least one retry occurred. |

## Status values

| Value | Meaning |
| success | Request was forwarded and a valid response was received from the target. |
| failed | Request was rejected before forwarding (for example, authentication failure, policy denial, or rate limit). |
| gateway_fault | Gateway encountered an error after forwarding the request (for example, target unreachable, timeout, or circuit breaker open). |

## Direction values

| Value | Meaning |
| request | Record captures metrics for the inbound leg of the request, from caller to gateway. |
| response | Record captures metrics for the outbound leg, from gateway to caller. |

## Metric type values

| Value | Meaning |
| channel | Record originates from a surface request (A2A, AP2, or MCP protocol). |
| mcp_proxy | Record originates from an MCP proxy interaction. |

## Related

- [Observability](/products/affinidi-trust-fabric/agent-gateway/concepts/observability.md): Overview of traces, metrics, and logs, including what is exported via OTLP and how the management dashboard visualises per-surface traffic data.
