Adding sdk tracing capabilities on spring#1713
Conversation
Signed-off-by: salaboy <Salaboy@gmail.com>
a5cd05e to
cbb117c
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #1713 +/- ##
============================================
- Coverage 79.54% 72.95% -6.60%
- Complexity 2196 2253 +57
============================================
Files 238 242 +4
Lines 6591 7409 +818
Branches 732 738 +6
============================================
+ Hits 5243 5405 +162
- Misses 990 1643 +653
- Partials 358 361 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
This PR adds Spring Boot tracing capabilities using the Micrometer Observation API. It provides transparent observation/span creation for Dapr client operations without requiring changes to consumer code. The implementation includes decorator wrappers for both DaprClient and DaprWorkflowClient that create named Micrometer observations for each non-deprecated method call, making traces available to OpenTelemetry and other observability backends.
Changes:
- New
ObservationDaprClientandObservationDaprWorkflowClientdecorator classes that wrap client calls with Micrometer observations - Updated auto-configuration to conditionally wrap clients when a non-noop
ObservationRegistryis available - Comprehensive test coverage for the new observation wrappers and auto-configuration behavior
- Added micrometer-observation dependencies (marked as optional)
Reviewed changes
Copilot reviewed 11 out of 11 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
ObservationDaprClient.java |
Decorator implementing DaprClient to wrap all non-deprecated method calls with Micrometer observations and high-cardinality key values |
ObservationDaprWorkflowClient.java |
Subclass of DaprWorkflowClient that overrides non-deprecated methods to wrap calls with observations |
DaprClientAutoConfiguration.java |
Updated to conditionally wrap clients with observation decorators when an ObservationRegistry is present |
DaprClientSB4AutoConfiguration.java |
Spring Boot 4 variant with same observation-wrapping logic |
pom.xml (both variants) |
Added micrometer-observation dependencies as optional dependencies |
| Test files | Comprehensive test coverage for observation creation, error handling, and auto-configuration behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Description
Adding Spring Boot tracing capabilities using Observation API from micrometer. This adds support for not using auto instrumentation.
Issue reference
We strive to have all PR being opened based on an issue, where the problem or feature have been discussed prior to implementation.
Please reference the issue this PR will close: #[issue number]
Checklist
Please make sure you've completed the relevant tasks for this PR, out of the following list: