Skip to main content

traceAI-a2a

OpenTelemetry instrumentation for the Google Agent-to-Agent (A2A) Protocol — distributed tracing across multi-agent boundaries.

PyPI License OpenTelemetry


The Problem

When an orchestrator agent calls a remote specialist agent over A2A, the trace breaks. The child agent starts a fresh trace. There is no parent-child link, no distributed context propagation, no visibility into what the remote agent did.

traceai-a2a fixes this.


What Gets Captured

Data Attribute
Task ID gen_ai.a2a.task.id
Task State gen_ai.a2a.task.state
Remote Agent URL gen_ai.a2a.agent.url
AgentCard Name gen_ai.a2a.agent.card.name
AgentCard Version gen_ai.a2a.agent.card.version
Message Role gen_ai.a2a.message.role
Message Parts Count gen_ai.a2a.message.parts.count
SSE Streaming gen_ai.a2a.streaming
Artifact Type gen_ai.a2a.artifact.type
Propagated Trace ID gen_ai.a2a.propagated_trace_id

Install

pip install traceAI-a2a

For A2A SDK support:

pip install "traceAI-a2a[a2a]"

Quickstart

import os
from fi_instrumentation import register
from fi_instrumentation.fi_types import ProjectType
from traceai_a2a import A2AInstrumentor

os.environ["FI_API_KEY"] = "<your-api-key>"
os.environ["FI_SECRET_KEY"] = "<your-secret-key>"

# Register tracer provider
trace_provider = register(
    project_type=ProjectType.OBSERVE,
    project_name="my_multi_agent_app"
)

# Instrument A2A — tracing propagates across agent boundaries automatically
A2AInstrumentor().instrument(tracer_provider=trace_provider)

# Now use A2AClient as normal — both agents appear in the same trace!
from a2a.client import A2AClient
import httpx

async with httpx.AsyncClient() as http_client:
    client = A2AClient(httpx_client=http_client, url="http://specialist-agent:8080")
    task_id = await client.send_task(
        payload={
            "message": {
                "role": "user",
                "parts": [{"type": "text", "text": "Summarize the Q3 report"}]
            }
        }
    )

How It Works

Orchestrator Agent                      Specialist Agent
─────────────────                       ────────────────
[span: A2A_CLIENT]                      [span: A2A_SERVER]  ← child of A2A_CLIENT span
  task_id: abc123          ────────────→   task_id: abc123
  agent_url: http://...    traceparent     message_role: user
  streaming: false         header injected  [span: LLM]
  task_state: completed ←────────────       model: gpt-4

Both spans share the same trace ID — giving you end-to-end visibility across agent boundaries in a single FutureAGI trace view.


ASGI Server Middleware

For the receiving agent (Starlette/FastAPI):

from starlette.applications import Starlette
from traceai_a2a import A2ATracingMiddleware

app = Starlette()
app.add_middleware(A2ATracingMiddleware, tracer_provider=trace_provider)

The middleware automatically extracts the incoming traceparent header and creates child spans in the distributed trace.


See Also

Metadata

Release files for traceAI-a2a 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for traceAI-a2a 0.1.0
File Size Uploaded Provenance Actions
traceai_a2a-0.1.0.tar.gz 13.1 kB With provenance Details for traceai_a2a-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for traceAI-a2a 0.1.0
File Interpreter ABI Platform Actions
traceai_a2a-0.1.0-py3-none-any.whl Python 3 none any Details for traceai_a2a-0.1.0-py3-none-any.whl

Total release size: 28.3 kB

Release files / traceai_a2a-0.1.0.tar.gz

Download URL traceai_a2a-0.1.0.tar.gz
Size 13.1 kB
Tags Source
SHA-256 checksum
How to use checksums
98498edc86c53d18d065f3f0294a3fd497de2678cdb47aae80a0a5a710fa98bc
BLAKE2b-256 checksum
How to use checksums
a1447a6c602dfc615b2d524b9ba1f032fbe598ae4fc3c9bf56c56395b4438948
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Release files / traceai_a2a-0.1.0-py3-none-any.whl

Download URL traceai_a2a-0.1.0-py3-none-any.whl
Size 15.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
87f4a9041d9799f8a2a95aa4b9050b25c228be08f039f4c393d6c02ca9b042af
BLAKE2b-256 checksum
How to use checksums
3f44c53368477ca3e20072fbd7c29e66a373bbc5223e1d2757a9f0da0a3a31b9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

Security for traceAI-a2a 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for traceai_a2a-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 31, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page