Trace a request's journey across both gateways

Follow one request from the gateway that forwards it, across a gateway connection, to the gateway whose managed agent serves it, by matching its trace ID on each gateway’s Audit page.

This guide follows one request across a gateway connection by its trace ID, from the audit records on the gateway that forwarded it to the records on the gateway whose managed agent served it. The gateway where a request enters gives it a trace ID and sends that ID with the request over the connection, so the receiving gateway files its own records for the request under the same ID. For what each audit record holds, see Audit log.

Each gateway shows only its own records on its Audit page. Without the shared trace ID, tying a refusal on one gateway to a request on the other means comparing times and surface names by hand, and in a cross-organisation setup the two pages belong to different operators.

Use this guide when:

  • A request that crossed a gateway connection was refused, and you need to know which gateway refused it and why.
  • A partner organisation asks about a request that your gateway forwarded to it or received from it.
  • You have set up a new route between two gateways and want to see the policy decisions and checks each side applied to one request.

You do not need this guide for a request that stays on one gateway, because the This request filter on that gateway’s Audit page already lists its records for the request. For a Transit Point whose destination is another gateway’s entry point URL (Direct URL), follow Follow a request on both gateways instead.

Prerequisites

  • Two connected gateways, where a surface on the sending gateway reaches a surface on the receiving gateway through a Managed Agent or Transit Point whose Endpoint Type is via Gateway Connection. Set this up with Authenticate requests between two gateways, or with Verify agents across organisations with a trust registry with its Transit Point set to via Gateway Connection instead of Direct URL.
  • On each gateway, Enable VP Auditing is on in Settings › Security, and Events to keep includes Policy Decision, Trust Check, Trace Terminated, VP Injected, Identity Binding Verified, Identity Binding Failed, and Request Rejected. A gateway writes records only for the events selected when the request arrives. See Settings reference: Security tab.
  • A Policy element on the surface on each gateway, so that each side writes a Policy Decision record for the request whether it allows or denies it. A gateway that applies no policy or Trust Check to a request, and doesn’t refuse it, has no audit record of the request to start from.
  • The Administrator role on each gateway, by default, to open the Audit page. In a cross-organisation setup, each organisation reads only its own gateway, so agree with the partner how operators share a trace ID, for example in a support ticket.

Steps

Open a record of the request

On the gateway where you noticed the request, either the sending or the receiving one, select Audit in the sidebar. Find a record of the request: for example, select Policy Decisions in Category, or type the surface’s name in Filter Audit Log… and press Enter. Hover over a record’s time to see its full date and time, then select the record.

The Event details panel opens. The chip beside Event details shows the request’s trace ID, a value such as 4dfcbc74-9697-4e21-9434-d1a5045cdf80.

List this gateway’s records for the request

Select This request. The trace ID moves into Filter Audit Log…, the list keeps only the records that carry it, and Request journey lists them in pipeline order, with response-leg policy decisions after the request leg. The list then selects its first record, so select the record you were reading again to bring it back into Event details. Copy the trace ID from Filter Audit Log….

On the sending gateway, the list can also hold an Identity Binding Failed record for the request when the caller sent no agent identity. It doesn’t affect the trace.

Sending gateway's Audit page after This request, with the trace ID in Filter Audit Log... and the list narrowed to the request's 4 records, with its Allowed policy decision selected. The Event details panel shows the same trace ID chip, the This request button, and the Request journey: the Allowed policy decision, two Verifiable Presentation injected records, and an Identity Binding Failed record

Check whether the sending surface terminated the trace

On the sending gateway, look in the filtered list for a record titled Trace terminated at egress. It is written when the sending surface has Terminate trace at egress (keep own trace, forward a fresh one downstream) on, and the receiving gateway then files its records under a fresh trace ID. Select the record and copy Downstream trace from its details: that is the trace ID to search for on the receiving gateway. Own trace is the ID you already have.

When you started on the receiving gateway, you hold the downstream trace ID. Search the sending gateway for it the same way: the Trace terminated at egress record matches, because it stores your trace ID as its downstream trace, beside the sending gateway’s own trace ID. Select it, then This request, to list the sending gateway’s records under its own trace ID.

When the list has no such record, the trace ID is the same on both gateways.

Sending gateway's Audit page filtered to one request's own trace ID, listing its 4 records with a Trace terminated at egress record selected. Its summary reads own followed by the sending gateway's trace ID, then downstream followed by a fresh trace ID. The Event details panel shows the trace ID chip, the This request button, and under Details the Trace group with Own trace and Downstream trace

Find the same request on the other gateway

Open the other gateway’s Audit page, paste the trace ID into Filter Audit Log…, and press Enter. In a cross-organisation setup, send the trace ID to the partner’s operator, who searches their own gateway.

Select one of the records that match. Its Request journey lists the other gateway’s side of the same request.

Receiving gateway's Audit page with the same trace ID in Filter Audit Log..., listing an Allowed policy decision whose summary names the Fabric leg, a Verifiable Presentation injected record, and an Identity Binding Verified record. The Event details panel shows the same trace ID chip and the Policy group with the policy, Scope Surface, Flow Fabric, and Decision allow

Tell the two sides apart

The receiving gateway marks the records of a request that arrived over the gateway connection:

RecordWhat shows that the request arrived over the connection
Policy decisionIts summary names the Fabric leg, and Flow in its details reads Fabric.
Request refusedIt reads “Refused over Fabric, so no HTTP status was recorded.”
Verifiable Presentation injected, Identity Binding Verified, or Identity Binding FailedVia fabric in its details reads Yes (G2G).

On the sending gateway, a Verifiable Presentation injected record for the forwarded request also shows Via fabric Yes (G2G).

The gateway whose journey holds a Denied policy decision or Request refused, or on the receiving gateway Trust check failed, is the one that refused the request. A failed Trust Check on the sending gateway isn’t listed under This request, so find it as in Troubleshooting. Its details give the reason: Deny reason for a policy, Failure for a Trust Check, and the Refusal group for a refused request.

Confirm

Test 1: request across the connection returns 200 and appears on both gateways

Send a request to the sending surface that it forwards over the gateway connection, with the request for the surface’s protocol:

curl -X POST "<SENDING_SURFACE_ENTRY_POINT_URL>" \
  -H "Content-Type: application/json" \
  -H "A2A-Version: 0.3" \
  -H "X-Client-Key: <CALLER_KEY>" \
  -d '{"jsonrpc":"2.0","method":"message/send","id":1,"params":{"message":{"messageId":"trace-1","role":"user","parts":[{"kind":"text","text":"Hello"}]}}}'
curl -X POST "<SENDING_SURFACE_ENTRY_POINT_URL>" \
  -H "Content-Type: application/json" \
  -H "X-Client-Key: <CALLER_KEY>" \
  -d '{"jsonrpc":"2.0","method":"initialize","id":1,"params":{"protocolVersion":"2024-11-05","clientInfo":{"name":"test","version":"1.0"},"capabilities":{}}}'

Replace X-Client-Key with the header that the sending surface’s Caller Context reads. If the receiving surface also authenticates callers, add the header and key it reads, or have the sending surface inject them with Target Authentication, as in Authenticate requests between two gateways.

Expected: 200 with the managed agent’s response. On the sending gateway’s Audit page, the request’s policy decision reads Allowed. After This request, searching the receiving gateway for the same trace ID lists the receiving gateway’s policy decision for the request.

Test 2: receiving gateway’s record for the trace ID names the Fabric leg

On the receiving gateway, select the policy decision found in Test 1.

Expected: its summary names the Fabric leg, Flow in its details reads Fabric, and the trace ID chip beside Event details matches the one on the sending gateway, or the Downstream trace when the sending surface terminates the trace.

Troubleshooting

SymptomLikely causeFix
The receiving gateway finds no records for the trace ID, and the sending gateway lists Trace terminated at egress for the request.The sending surface terminates the trace, so the receiving gateway uses a fresh trace ID.Search the receiving gateway for the record’s Downstream trace, as in Step 3.
The receiving gateway finds no records for the trace ID, and the caller got the managed agent’s response.Enable VP Auditing was off on the receiving gateway, or Events to keep left out the request’s events, when the request arrived.On the receiving gateway, select the events in Settings › Security and select Save, then send a new request. A gateway writes records only for requests that arrive after the change.
The receiving gateway finds no records for the trace ID, and the caller got an error or a timeout.The request didn’t reach the receiving gateway.On Connections › Gateways on each gateway, check that the Status reads ACTIVE and shows “Peer seen” with a recent time. “Peer not heard from since this gateway started” means no message from the other gateway has arrived since it last started. See Connect two gateways.
A refusal you expect on the receiving gateway is missing from the trace ID search.The refusal record doesn’t carry the trace ID you searched for.Type the receiving surface’s name in Filter Audit Log… and press Enter. Match the record by its time, shown in full when you hover over it, and check that Via fabric in its details reads Yes (G2G).
The sending gateway has no record of the request.The sending surface applied no policy to the request and didn’t refuse it.Start from the receiving gateway’s record instead, since Step 1 works on either gateway. To record every request on the sending side, add a Policy element to the sending surface.
A Trust Check on the sending gateway failed, and This request lists no Trust check failed record for the request.A Trust Check refusal on the sending gateway isn’t listed under This request.Type the sending surface’s name in Filter Audit Log… and press Enter. Match the Trust check failed record by its time, shown in full when you hover over it.
This request is missing from Event details.The selected record carries no trace ID.Select another record of the same request, such as its policy decision.

Next steps

  • Audit log: What each audit event records, and how the Audit page filters and groups records by trace ID.
  • Observability: The trace ID across logs, metrics, and audit records.
  • Gateways: How two gateways route requests to each other over a gateway connection.
  • Surface reference: The Terminate trace at egress setting.
  • Settings reference: Audit events: Every audit event, with its group and description.