Skip to content

Adding sdk tracing capabilities on spring#1713

Open
salaboy wants to merge 1 commit intodapr:masterfrom
salaboy:dapr-spring-tracing
Open

Adding sdk tracing capabilities on spring#1713
salaboy wants to merge 1 commit intodapr:masterfrom
salaboy:dapr-spring-tracing

Conversation

@salaboy
Copy link
Copy Markdown
Collaborator

@salaboy salaboy commented Apr 6, 2026

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:

  • Code compiles correctly
  • Created/updated tests
  • Extended the documentation

@salaboy salaboy requested review from a team as code owners April 6, 2026 21:44
Signed-off-by: salaboy <Salaboy@gmail.com>
@salaboy salaboy force-pushed the dapr-spring-tracing branch from a5cd05e to cbb117c Compare April 6, 2026 21:44
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 7, 2026

Codecov Report

❌ Patch coverage is 20.00000% with 656 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.95%. Comparing base (14c41cf) to head (cbb117c).

Files with missing lines Patch % Lines
...t4/autoconfigure/client/ObservationDaprClient.java 0.00% 286 Missing ⚠️
...ot/autoconfigure/client/ObservationDaprClient.java 31.46% 196 Missing ⚠️
...onfigure/client/ObservationDaprWorkflowClient.java 0.00% 116 Missing ⚠️
...onfigure/client/ObservationDaprWorkflowClient.java 53.44% 53 Missing and 1 partial ⚠️
...nfigure/client/DaprClientSB4AutoConfiguration.java 50.00% 2 Missing and 2 partials ⚠️
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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 ObservationDaprClient and ObservationDaprWorkflowClient decorator classes that wrap client calls with Micrometer observations
  • Updated auto-configuration to conditionally wrap clients when a non-noop ObservationRegistry is 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.

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.

2 participants