Repository navigation
feat: Add otel support for client - #1504
Draft
Iwaniukooo11 wants to merge 4 commits into
Draft
Iwaniukooo11 wants to merge 4 commits into
Iwaniukooo11 wants to merge 4 commits into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/client/base_client.py | 96.74% | 96.77% | 🟢 +0.04% |
| src/a2a/plugins/otel/_plugin.py (new) | — | 97.06% | — |
| src/a2a/plugins/otel/_semconv.py (new) | — | 94.12% | — |
| Total | 93.81% | 93.87% | 🟢 +0.05% |
Generated by coverage-comment.yml
This branch has not been deployed
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.
Description
Adds
OpenTelemetryPluginwithclientsupportA2A_OTEL_PLUGIN_ENABLED=falseturns it into a no-op.opentelemtry-sdkinstalled raisesOTEL unrelated change
_execute_with_interceptorsinbase_client.pynow callsafter_client_requestinfinally.Before, a cancelled unary call (for example a timeout) skipped the hook, so its span was never ended.
Actual change
CLIENTspan per call, named with the semconv method nametraceparentis injected into the outgoing headers, so the agent can join the trace.wrap_client_callmakes the span currentAssumptions
ListTasks: task id and context id are never reported, whatever the number of tasks.task_idfirst.idis used only where it is the task id (GetTask,CancelTask,SubscribeToTask, aTaskresponse). On push config requestsidis the config id, so it is never reported.use_spanruns withrecord_exception=Falseandset_status_on_exception=False. Otherwise OTel adds anexceptionspan event and sets the status on its own. Span events are out of scope, and the status is set only in our final hook.schema_urlis not set yet, assemantic-conventions-genaihas no release.Tests
ListTasks, and task id vs config id.error.type, an error mid-stream, and success leaving the status unset.