Skip to content
1 change: 1 addition & 0 deletions gateway/1.11/modules/ROOT/nav.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@
*** xref:policies-included-a2a-pii-detector.adoc[A2A PII Detector]
*** xref:policies-included-a2a-prompt-decorator.adoc[A2A Prompt Decorator]
*** xref:policies-included-a2a-schema-validation.adoc[A2A Schema Validation]
*** xref:policies-included-agent-connection-telemetry.adoc[Agent Connection Telemetry Policy]
*** xref:policies-included-basic-auth-ldap.adoc[Basic Authentication: LDAP]
*** xref:policies-included-basic-auth-simple.adoc[Basic Authentication: Simple]
*** xref:policies-included-client-id-enforcement.adoc[Client ID Enforcement]
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
= Agent Connection Telemetry Policy
ifndef::env-site,env-github[]
include::_attributes.adoc[]
endif::[]
:imagesdir: ../assets/images
:keywords: api gateway, flex gateway, gateway, policy, agent, telemetry, agent connection, A2A, MCP

[width="100%", cols="5,15"]
|===
>s| Policy Name | Agent Connection Telemetry
>s|Summary | Tracks the number of requests made to agent or MCP server instances
>s|Category | A2A and MCP
>s|First Flex Gateway version available | 1.11.0
^s| Returned Status Codes | No return codes exist for this policy.
|===

== 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

include::partial$policy-title-headers.adoc[tag=configFileTitleOnly]

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

include::partial$policy-title-headers.adoc[tag=ui]

[%header%autowidth.spread,cols="a,a"]
|===
| Element | Description
| Source Agent ID | DataWeave expression to extract the source identification value from the request header. By default, the `#[attributes.headers['X-AGENT-ID']]` expression extracts the Mulesoft instance ID.
|===

Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ endif::[]
| xref:policies-included-a2a-pii-detector.adoc[A2A PII Detector] | A2A | Detects personally identifiable information (PII) in requests sent to the agent
| xref:policies-included-a2a-prompt-decorator.adoc[A2A Prompt Decorator] | A2A | Decorates prompts with context information
| xref:policies-included-a2a-schema-validation.adoc[A2A Schema Validation] | A2A | Validates Agent requests to ensure they conform to the A2A specification
| xref:policies-included-agent-connection-telemetry.adoc[Agent Connection Telemetry] | A2A and MCP | Tracks the number of requests made to agent or MCP server instances
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove hard-coded link text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We do this because policy is in the title of the page. I get that it's not ideal, but because policy names don't really change, I think our current system is fine.

| xref:policies-included-basic-auth-ldap.adoc[Basic Authentication: LDAP] | Security | Allows access based on the basic authorization mechanism, with user-password defined on LDAP
| xref:policies-included-basic-auth-simple.adoc[Basic Authentication: Simple] | Security | Allows access based on the basic authorization mechanism, with a single user-password
| xref:policies-included-client-id-enforcement.adoc[Client ID Enforcement] | Compliance | Allows access only to authorized client applications
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ endif::[]

| A2A Schema Validation ^| xref:gateway::policies-included-a2a-schema-validation.adoc[✓] ^| | Validates Agent requests to ensure they conform to the A2A specification

| Agent Connection Telemetry ^| xref:gateway::policies-included-agent-connection-telemetry.adoc[✓] ^| | Tracks the number of requests made to agent or MCP server instances

| AWS Lambda ^| xref:gateway::policies-outbound-aws-lambda.adoc[✓] ^| | Allows access based on the basic authorization mechanism, with user-password defined on LDAP

| AWS Request Signature ^| xref:gateway::policies-outbound-aws-signature.adoc[✓] ^| | Signs outgoing requests with AWS Signature Version 4 (SigV4) or Signature Version 4A (SigV4A)
Expand Down