Observability
Every A2A call emits a usage event and updates the gateway's request metrics on the same pipelines as model traffic. Both are tagged with an A2A marker, so you can isolate A2A traffic without a separate telemetry stack. Rejected calls — rate-limited, budget-exceeded, or failed upstream — emit events too, so telemetry reflects every attempt, not only successful calls.
Usage Events
Each A2A call emits one usage event into the same sink as model usage. The event carries:
| Field | Value |
|---|---|
inbound_protocol | a2a |
a2a_agent_name | The registered agent that was called. |
a2a_method | The JSON-RPC method invoked, such as message/send. |
api_key_id | The caller API key that made the call. |
status_code | The call's outcome status. |
latency_ms | End-to-end call latency. |
request_id, occurred_at | Correlation id and timestamp. |
Token and cost fields are zero for A2A calls, because a call carries no model tokens. Use a2a_agent_name and a2a_method for per-agent call-volume attribution rather than token or spend analytics.
The event records the agent name, the method, and the outcome — it does not include the request or response message content. It also does not yet break out A2A task identifiers (task id, context id) or task state as separate fields; use a2a_method and status_code for attribution.
A2A usage events are delivered on the same paths as model usage events:
- In AISIX Cloud managed deployments, they flow to the control-plane usage sink alongside model usage.
- They also fan out to any per-environment OTLP, SLS, or Datadog exporters you configure, so A2A traffic appears in the same exporters as the rest of your gateway traffic.
Metrics
A2A requests appear in the gateway's Prometheus metrics, tagged so you can filter them apart from model traffic:
- The request counter
aisix_requests_totaltags A2A calls withprovider="a2a"andmodel="a2a", alongsidestatusandoutcome. - The in-flight request gauge
aisix_proxy_in_flight_requeststags A2A requests withendpoint="/a2a"andinbound_protocol="a2a". - The usage-emission counter
aisix_usage_events_emitted_totaltags A2A events withhandler="a2a".
On aisix_usage_events_emitted_total, the inbound_protocol label is drawn from a fixed set (openai, anthropic, mcp, other), so A2A events fall under inbound_protocol="other" on that counter. Filter A2A emission by handler="a2a" instead. The delivered usage event itself carries inbound_protocol="a2a" with the agent name and method.
Metrics are exposed on GET /metrics through the dedicated metrics listener. For the full metric catalog and label semantics, see Metrics Reference.
Verification
Send one A2A call through the gateway, then scrape the metrics endpoint:
curl -sS "http://127.0.0.1:9090/metrics" | grep -E 'handler="a2a"|provider="a2a"'
Expected result: the output includes an aisix_usage_events_emitted_total sample tagged handler="a2a" and an aisix_requests_total sample tagged provider="a2a". Adjust the address to match your observability.metrics.prometheus.addr. Metric families register on first observation, so send a call before scraping.
Next Steps
- Metrics Reference — the full metric catalog, labels, and A2A notes.
- Rate Limits and Budgets — rejected A2A calls emit events with the rejection status.
- Agent Gateway Overview — register an agent and reach it end to end.