feat(a2aext/trace): W3C traceparent-based audit trail with MCP bridge hooks - #377
Open
kuangmi-bit wants to merge 1 commit into
Open
feat(a2aext/trace): W3C traceparent-based audit trail with MCP bridge hooks#377kuangmi-bit wants to merge 1 commit into
kuangmi-bit wants to merge 1 commit into
Conversation
…ridge hooks Alternative implementation of a2aproject#365 with improvements: - W3C traceparent format (00-{trace_id}-{span_id}-{flags}) as primary encoding - Backward-compatible with legacy semicolon format via ParseTraceHeader - Child spans inherit parent TaskID/ContextID by default - BridgeToMCP() / BridgeFromMCP() hooks for cross-protocol propagation - Strict validation: non-empty hex Check, 32-char trace ID, 16-char span ID - Updated Chain() docs clarifying it returns current agent:span identity - 20 tests covering: root/child span creation, W3C encode/decode, 3-hop chain, inheritance, bridge hooks, ID collisions, legacy format, invalid inputs Zero regressions on existing a2aext/a2asrv/push/taskstore/workqueue suites. Related: a2aproject#365 (gemini-code-assist original), deeparchi-ai/macs trace-bridge spec, a2aproject/A2A#2026 (trace context proposal)
Contributor
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
Contributor
Author
|
@yarolegovich @nahapetyan-serob — gentle ping for review. This PR adds W3C traceparent-based audit trail with MCP bridge hooks. All CI green (4✓), mergeable. Related: spec discussion at a2aproject/A2A#2026. |
Contributor
Author
|
@nahapetyan-serob would appreciate a review when you have time. This PR is complementary to #365 — same audit trail domain, different approach:
All CI checks pass. The |
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.
Summary
Alternative/complementary implementation of #365 with three key additions:
1. W3C traceparent format
Uses standard W3C Trace Context encoding (
00-{trace_id}-{span_id}-{flags}) instead of a custom semicolon format. This enables interoperability with OpenTelemetry, MCP trace context, and any W3C-compliant observability stack.Backward-compatible:
ParseTraceHeaderaccepts both W3C and legacy formats.2. Review fixes from #365
NewChildSpannow defaults to parent's TaskID/ContextID when emptyParseTraceparentvalidates non-empty hex, 32-char trace ID, 16-char span ID3. Cross-protocol bridge hooks
Testing
20 tests, zero regressions on existing a2aext/a2asrv suites.
Relationship to #365
This is not a replacement — it is an alternative direction. #365 got the architecture right (interceptor pattern + context propagation). This PR adds W3C format + bridge hooks + review fixes. If maintainers prefer #365's approach, the bridge hooks and review fixes can be cherry-picked onto it.
Related: