Repository navigation
feat: Add opentelemtry server plugin support - #1524
Merged
Iwaniukooo11 merged 10 commits intoNov 27, 2026
Merged
Iwaniukooo11 merged 10 commits into
Iwaniukooo11 merged 10 commits into
Conversation
🧪 Code Coverage (vs
|
| Base | PR | Delta | |
|---|---|---|---|
| src/a2a/plugins/otel/plugin.py | 97.50% | 95.00% | 🔴 -2.50% |
| src/a2a/utils/telemetry.py | 90.70% | 91.61% | 🟢 +0.91% |
| Total | 94.19% | 94.17% | 🔴 -0.03% |
Generated by coverage-comment.yml
Iwaniukooo11
marked this pull request as ready for review
November 25, 2026 15:37
Iwaniukooo11
marked this pull request as draft
November 25, 2026 15:38
Iwaniukooo11
marked this pull request as ready for review
November 26, 2026 10:27
mykytanetipa
requested changes
Nov 26, 2026
mykytanetipa
left a comment
Collaborator
There was a problem hiding this comment.
LGTM overall, left minor comments
mykytanetipa
approved these changes
Nov 26, 2026
Iwaniukooo11
merged commit Nov 27, 2026
e1ce851
into
a2aproject:mateusziwaniuk/feat-otel
24 checks passed
Iwaniukooo11
added a commit
that referenced
this pull request
Nov 27, 2026
## Description - Adds `OpenTelemetryPlugin`, which reports A2A client and server calls as spans, aligned with open-telemetry/semantic-conventions-genai#195. - Combines #1504 and #1524, nothing else added. - Marked `@experimental`. `A2A_OTEL_PLUGIN_ENABLED=false` turns it into a no-op, and creating it without OpenTelemetry installed raises an error with an install hint. - Client: one `CLIENT` span per call, named after the A2A method; `traceparent` is sent so the server joins the trace. - Server: reuses the HTTP/gRPC transport span if there is one (enrichment), otherwise creates its own `SERVER` span under the caller's trace (standalone). It only ends spans it created. - Legacy tracing (`a2a.utils.telemetry`) is deprecated and turned off once the plugin is created, so calls aren't traced twice. - btw: the client's after-request hook now always runs, so a cancelled or timed-out call still ends its span. ## Assumptions - `ListTasks` never reports task or context ids. - Streaming calls don't report task state, because it changes during the stream. - Push config requests don't report a task id, because their `id` is the config id. - Server spans read the protocol version from the `A2A-Version` header. - A server span is treated as a transport span only if it has HTTP or gRPC attributes (same rule as a2a-go). - Server spans don't report the client's host or port. - `schema_url` is left unset until `semantic-conventions-genai` is released. ## Tests - Span name and kind for every method, client and server. - Attributes for unary, streaming and `ListTasks` calls. - Trace propagation and span nesting, including gRPC metadata edge cases. - Reusing the transport span vs creating a new one. - Errors, cancellation, timeouts and early stream close. - Disabled plugin, missing OpenTelemetry, and legacy tracing handling. - **Manual end-to-end run with Jaeger** - Release-As: 1.4.0
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.
Changes:
Otelinto hooks:before,wrap,after_CallStategainsis_owned(True if standalone, False if enrichment) - We can't close span which is not owned by server_grpc_carrieris introduced to avoid errors when gRPC metadata are empty / are not UTF-8request/responseattributes to ensure better readability (and splitting logic forClientRequest/ServerRequest)Assumptions / Decisions
a2a versionis read from headerserverdoesn't collect clienthost/portTests
jaeger