Skip to main content

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:

FieldValue
inbound_protocola2a
a2a_agent_nameThe registered agent that was called.
a2a_methodThe JSON-RPC method invoked, such as message/send.
api_key_idThe caller API key that made the call.
status_codeThe call's outcome status.
latency_msEnd-to-end call latency.
request_id, occurred_atCorrelation 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_total tags A2A calls with provider="a2a" and model="a2a", alongside status and outcome.
  • The in-flight request gauge aisix_proxy_in_flight_requests tags A2A requests with endpoint="/a2a" and inbound_protocol="a2a".
  • The usage-emission counter aisix_usage_events_emitted_total tags A2A events with handler="a2a".
Filtering the emission counter

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

API7.ai Logo

The digital world is connected by APIs,
API7.ai exists to make APIs more efficient, reliable, and secure.

Sign up for API7 newsletter

Product

API7 Gateway

SOC2 Type IIISO 27001HIPAAGDPRRed Herring

Copyright © APISEVEN PTE. LTD 2019 – 2026. Apache, Apache APISIX, APISIX, and associated open source project names are trademarks of the Apache Software Foundation