Skip to content

feat(opentelemetry): add push notification tracing and trace-context propagation - #1229

Merged
kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:issue_1217
Oct 22, 2026
Merged

kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:issue_1217

Conversation

@ehsavoie

Copy link
Copy Markdown
Collaborator
  • Add OpenTelemetryPushNotificationSenderDecorator with CLIENT spans that reflect actual delivery outcome (OK on success, ERROR on failure)
  • Add OpenTelemetryA2AHttpClient to inject W3C traceparent/tracestate headers into outbound push notification HTTP requests
  • Change PushNotificationSender.sendNotification() from void to boolean so decorators can observe delivery success or failure
  • Use @Alternative @priority(1) to resolve CDI ambiguity on A2AHttpClient
  • DRY: merge extractTaskId/extractContextId into single extractIds()
  • Fix null safety in span error description
  • Remove LENIENT Mockito strictness, stub only in tests that need it
  • Refactor integration test helpers: shared HttpClient, Gson, clearExportedSpans()
  • Use HashMap instead of ConcurrentHashMap where CopyOnWriteArrayList suffices

Fixes #1217 🦕

@ehsavoie

Copy link
Copy Markdown
Collaborator Author

Supersedes #1228

@kabir

kabir commented Oct 21, 2026

Copy link
Copy Markdown
Collaborator
  • P2 — Custom dispatch executors cannot override the default: OpenTelemetryHttpClientProducer.java:112 produces a normal-scoped @nAmed("a2a.pushNotificationDispatch") Executor. If an application follows the documented override approach and defines its own executor with that name, CDI sees two matching beans. Consequently, BasePushNotificationSender.java:123 finds the Instance ambiguous (isResolvable() == false) and silently falls back to the common pool. This defeats the advertised override and loses trace-context propagation. Use an explicit override mechanism (for example specialization or a documented alternative/priority scheme), and add an integration test with a user-provided named executor.

… propagation

BREAKING: PushNotificationSender.sendNotification() now returns boolean.

- OTel decorator creates CLIENT spans for push delivery with error tracking
- W3C traceparent/tracestate headers injected into outbound push notification requests
- @Instrumented CDI qualifier transparently wraps application HTTP client and dispatch executor
- Three-tier CDI resolution: @Instrumented → @Named/unqualified → built-in default

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@kabir
kabir merged commit 479eaf8 into a2aproject:main Oct 22, 2026
16 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Push notification delivery is completely untraceable

2 participants