You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 49b8dd0
Browse filesBrowse the repository at this point in the historyBrowse files
feat: Add OpenTelemetry tracing support with comprehensive testing and null safety
Added OpenTelemetry integration for distributed tracing across the A2A SDK:
- Added @trace annotation for CDI interceptors to create spans on method invocations
- Created SpanInterceptor with robust CDI proxy handling supporting 5 proxy patterns
- Added InvocationContext record for capturing method invocation details with:
* Null safety annotations (@NonNull/@nullable)
* Comprehensive JavaDoc documentation
* Specific exception declarations (IllegalAccessException, InvocationTargetException)
- Implemented attribute extractors for all transport types:
* GrpcAttributeExtractor with null-safe gRPC context key access
* JsonRPCAttributeExtractor with method name extraction
* RestAttributeExtractor with conditional attribute building
* RequestHandlerAttributeExtractor for default request handler
- Added ClientTransportWrapper SPI for wrapping transport operations
- Created OpenTelemetryClientTransport decorator supporting:
* All A2A client methods (sendMessage, getTask, listTasks, etc.)
* Streaming operations with event consumer wrapping
* Error consumer instrumentation
* Helper methods to eliminate code duplication
- Updated ClientBuilder to apply transport wrappers via ServiceLoader
- Added 21 comprehensive tests for OpenTelemetryClientTransport
- Added 12 tests for SpanInterceptor CDI proxy handling
- Added 10 tests for GrpcAttributeExtractor null safety
- All attribute extractors include defensive null checks preventing NPE
- 244 total tests passing in server-common module
- Updated HelloWorld example with OpenTelemetry integration:
* Added OTEL dependencies and configuration
* Configured trace export to console
* Added README documentation for running with telemetry
* Server now includes @trace annotation on agent method
- Added extras/opentelemetry module with dependencies
- Updated BOM with OpenTelemetry extras
- Added CDI beans.xml and ServiceLoader configuration
- Updated .gitignore for IDE and build artifacts
Fixes#388
Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
0 commit comments