Skip to content

[Backport release-1.17] Adding sdk tracing capabilities on spring#1723

Merged
javier-aliaga merged 1 commit intorelease-1.17from
backport-1713-to-release-1.17
Apr 10, 2026
Merged

[Backport release-1.17] Adding sdk tracing capabilities on spring#1723
javier-aliaga merged 1 commit intorelease-1.17from
backport-1713-to-release-1.17

Conversation

@dapr-bot
Copy link
Copy Markdown
Collaborator

Backport aa296fa from #1713.

* adding sdk tracing capabilities on spring

Signed-off-by: salaboy <Salaboy@gmail.com>

* fix: guard highCardinalityKeyValue calls against null values in ObservationDaprClient

Micrometer's highCardinalityKeyValue throws NPE when the value is null.
Added a safe() helper that coalesces nulls to empty string, applied to
all observation tag values in both Spring Boot 3 and Boot 4 modules.

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* fix: add null validation in constructors and fix license header formatting

Add Objects.requireNonNull for delegate and observationRegistry in
ObservationDaprClient and ObservationDaprWorkflowClient constructors
to fail fast on misconfiguration. Fix missing ' * ' prefix on the
last line of license headers in all four new files.

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* fix: defer observation start to subscription time in ObservationDaprClient

Wrap observe() and observeFlux() helpers with Mono.defer/Flux.defer so
that obs.start() runs on subscription, not on method call. This prevents
leaked spans when a Mono is never subscribed and ensures span timing
reflects actual execution, not the gap before subscription.

Signed-off-by: Javier Aliaga <javier@diagrid.io>

* fix: use proper Objects import, revert license header, add deferred-start test

Replace fully-qualified java.util.Objects with import statement and fix
alphabetical import order to satisfy checkstyle. Revert license header
change since the project's checkstyle config expects the original format.
Add test verifying that an unsubscribed Mono does not leak an observation.

Signed-off-by: Javier Aliaga <javier@diagrid.io>

---------

Signed-off-by: salaboy <Salaboy@gmail.com>
Signed-off-by: Javier Aliaga <javier@diagrid.io>
Co-authored-by: Yaron Schneider <schneider.yaron@live.com>
Co-authored-by: Javier Aliaga <javier@diagrid.io>
(cherry picked from commit aa296fa)
@dapr-bot dapr-bot requested review from a team as code owners April 10, 2026 12:48
@javier-aliaga javier-aliaga merged commit e387e49 into release-1.17 Apr 10, 2026
17 of 21 checks passed
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 10, 2026

Codecov Report

❌ Patch coverage is 20.09685% with 660 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.88%. Comparing base (af2aae9) to head (9ee2527).
⚠️ Report is 1 commits behind head on release-1.17.

Files with missing lines Patch % Lines
...t4/autoconfigure/client/ObservationDaprClient.java 0.00% 289 Missing ⚠️
...ot/autoconfigure/client/ObservationDaprClient.java 31.83% 196 Missing and 1 partial ⚠️
...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 ⚠️

❗ There is a different number of reports uploaded between BASE (af2aae9) and HEAD (9ee2527). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (af2aae9) HEAD (9ee2527)
2 1
Additional details and impacted files
@@                Coverage Diff                 @@
##             release-1.17    #1723      +/-   ##
==================================================
- Coverage           79.51%   72.88%   -6.64%     
- Complexity           2194     2254      +60     
==================================================
  Files                 237      241       +4     
  Lines                6577     7401     +824     
  Branches              730      736       +6     
==================================================
+ Hits                 5230     5394     +164     
- Misses                992     1648     +656     
- Partials              355      359       +4     

☔ 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.

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.

3 participants