Skip to content

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

Open
ehsavoie wants to merge 1 commit into
a2aproject:mainfrom
ehsavoie:issue_1217
Open

ehsavoie wants to merge 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

…propagation

PushNotificationSender.sendNotification() changed from void to boolean to let decorators observe delivery outcome.

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@Alternative
@Priority(1)
A2AHttpClient createPropagatingClient() {
return new OpenTelemetryA2AHttpClient(A2AHttpClientFactory.createExcluding("cdi"), openTelemetry);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • P1 — OTel bypasses applications’ custom CDI HTTP client: createPropagatingClient is an enabled alternative, so it wins CDI resolution over an application’s normal A2AHttpClient bean. It then deliberately excludes the cdi provider and wraps a built-in JDK/Vert.x client instead. This breaks the documented CDI customization path—for example, custom mTLS, proxy, authentication, or timeouts are silently ignored for push delivery whenever the OTel server extra is present. The propagating client needs to wrap the user-selected client rather than replace it (or use an explicit qualifier/configuration to avoid changing default selection).

This branch has not been deployed

No deployments
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