feat(go-adk): propagate A2A message metadata as OTEL span attributes#1737
Open
mesutoezdil wants to merge 3 commits intokagent-dev:mainfrom
Open
feat(go-adk): propagate A2A message metadata as OTEL span attributes#1737mesutoezdil wants to merge 3 commits intokagent-dev:mainfrom
mesutoezdil wants to merge 3 commits intokagent-dev:mainfrom
Conversation
Scalar values (string, bool, number) from the A2A message Metadata field are now set as attributes on the invocation span under the prefix a2a.message.metadata.<key>. Non-scalar values such as nested objects and lists are skipped to keep attributes flat and filterable. This lets callers attach contextual data to traces without a separate observability pipeline. A common case is human-in-the-loop approval flows where the approver identity is passed back via message/send and needs to appear in audit traces. Closes kagent-dev#1734 Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
Remove trailing switch comment that caused gofmt to report a formatting error, trim 4-line doc comment to one line (conventions: max one short line), and drop the call-site comment whose content is already expressed by the function name. Signed-off-by: mesutoezdil <mesudozdil@gmail.com>
b898cbd to
534ebd3
Compare
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.
Closes #1734
Scalar values from the A2A
message.metadatamap are now set as attributes on the invocation span under the prefixa2a.message.metadata.<key>. Non-scalar values (nested objects, lists) are silently skipped so attributes stay flat and filterable in any OTEL backend.This is useful for human-in-the-loop and external-trigger workflows where the caller needs to attach contextual data to a trace. A common case is an approval flow where a Slack bot sends back the approver identity via
message/sendand that identity needs to appear in audit traces without running a completely separate observability pipeline.The call happens on the already-active invocation span, right after
StartInvocationSpan, so all child spans (tool calls, LLM calls) are nested under the same root and the metadata is visible across the full trace.Supported types:
string,bool,float64,int,int64. Everything else is ignored.Tests cover the normal path (string, bool, float64), the nil/empty-map no-op case, and that nested maps and lists are not forwarded.
Signed-off-by: mesutoezdil mesudozdil@gmail.com