---
schema_version: "1"
id: 71f1ac4a8791ccaf743e614296cc967337323da0c1e88c2787edfceadceb5c3a
title: Agent Connection Telemetry Policy
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/gateway/1.12/policies-included-agent-connection-telemetry.md
canonical_url: https://docs.mulesoft.com/gateway/1.12/policies-included-agent-connection-telemetry
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 78fdd4df5bbbb58584eee151e8b55c9f510b5c4c89c19ff2bb6a4623a4fc87ea
description: MuleSoft Documentation Site
release: "1.12"
latest: false
---
---
product: Omni Gateway
version: 1.12
keywords: api gateway, flex gateway, gateway, policy, agent, telemetry, agent connection, A2A, MCP
---

# Agent Connection Telemetry Policy

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

<table><colgroup><col> <col></colgroup><tbody><tr><td><p><strong>Policy Name</strong></p></td><td><p>Agent Connection Telemetry</p></td></tr><tr><td><p><strong>Summary</strong></p></td><td><p>Tracks the number of requests made to agent or MCP server instances</p></td></tr><tr><td><p><strong>Category</strong></p></td><td><p>A2A and MCP</p></td></tr><tr><td><p><strong>First Flex Gateway version available</strong></p></td><td><p>1.11.0</p></td></tr><tr><td><p><strong>Returned Status Codes</strong></p></td><td><p>No return codes exist for this policy.</p></td></tr></tbody></table>

## Summary

The Agent Connection Telemetry policy tracks the number of requests and what source makes the
request to agent or MCP server instance.

To track the source of the request, the policy uses a DataWeave expression to extract an
identification value from a request header. By default, the policy extracts the `X-AGENT-ID` header.
The `X-AGENT-ID` header contains the Mulesoft instance ID.

To track the requests, the policy uses the `mulesoft_agent_connection_count(source, destination)`
metric. Where `source` is the identification value extracted from the request header and
`destination` is the agent or MCP server instance ID. Use Anypoint Monitoring to view the metric.

If the policy can’t extract the identification header, the policy doesn’t block or track the
request.

> [!NOTE] The Agent Connection Telemetry policy is applied by default to all agent and MCP server
> instances created using Agent Fabric.

## Configure Policy Parameters

### Flex Gateway Local Mode

The Agent Connection Telemetry policy isn’t supported in Local Mode.

### Managed Flex Gateway and Flex Gateway Connected Mode

When you apply the policy from the UI, the following parameters are displayed:

<table><colgroup><col> <col></colgroup><thead><tr><th>Element</th><th>Description</th></tr></thead><tbody><tr><td><div><div><p>Source Agent ID</p></div></div></td><td><div><div><p>DataWeave expression to extract the source identification value from the request header. By default, the <code>#[attributes.headers['X-AGENT-ID']]</code> expression extracts the Mulesoft instance ID.</p></div></div></td></tr></tbody></table>
