feat: add traceai-a2a - Agent-to-Agent Protocol instrumentation#153
Open
VaishnavGunjari wants to merge 1 commit intofuture-agi:mainfrom
Open
feat: add traceai-a2a - Agent-to-Agent Protocol instrumentation#153VaishnavGunjari wants to merge 1 commit intofuture-agi:mainfrom
VaishnavGunjari wants to merge 1 commit intofuture-agi:mainfrom
Conversation
Adds a new Python instrumentation package for Google's A2A Protocol, enabling distributed tracing across multi-agent boundaries. Key capabilities: - W3C TraceContext (traceparent/tracestate) propagation via A2AClient outbound HTTP headers, stitching multi-agent traces into one - A2AInstrumentor: zero-config instrumentation following BaseInstrumentor pattern, wrapping send_task() and send_task_streaming() with wrapt - A2ATracingMiddleware: ASGI middleware for inbound context extraction on the receiving agent side (Starlette/FastAPI compatible) - 11 new SpanAttributes in gen_ai.a2a.* namespace (task ID/state, agent URL, AgentCard name/version, message role, artifact type, streaming flag, push notification URL, propagated trace ID) - 2 new FiSpanKindValues: A2A_CLIENT and A2A_SERVER - 3 new EvalName values: a2a_task_completion, a2a_response_alignment, a2a_safety_pass_through - Full attribute extractor for Task, Message, AgentCard, and streaming artifact events (handles both SDK objects and raw dicts) - Complete multi-agent demo with mock agents (no real SDK required) - 16 unit tests: span creation, attribute recording, W3C propagation (the key end-to-end test), ASGI middleware, instrumentor lifecycle, error handling, and semantic convention completeness Files: python/fi_instrumentation/fi_types.py (modified) python/frameworks/a2a/pyproject.toml (new) python/frameworks/a2a/CHANGELOG.md (new) python/frameworks/a2a/README.md (new) python/frameworks/a2a/traceai_a2a/__init__.py (new) python/frameworks/a2a/traceai_a2a/_a2a_client.py (new) python/frameworks/a2a/traceai_a2a/_a2a_server.py (new) python/frameworks/a2a/traceai_a2a/_attributes.py (new) python/frameworks/a2a/traceai_a2a/_semantic_conventions.py (new) python/frameworks/a2a/traceai_a2a/version.py (new) python/frameworks/a2a/traceai_a2a/py.typed (new) python/frameworks/a2a/examples/multi_agent_demo.py (new) python/tests/test_framework_a2a.py (new)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a new Python instrumentation package for Google's A2A Protocol, enabling distributed tracing across multi-agent boundaries.
What this does:
-Propagates W3C TraceContext headers across agent boundaries, stitching multi-agent calls into a single trace
-A2AInstrumentor wraps send_task() and send_task_streaming() with zero config
-A2ATracingMiddleware extracts inbound trace context (FastAPI/Starlette compatible)
-11 new span attributes under gen_ai.a2a.* namespace
-Includes a full multi-agent demo and 16 unit tests
Checklist