Skip to content

feat(samples): [Cache Tracing 6] Add JCache console sample#5182

Open
adinauer wants to merge 5 commits intofeat/cache-tracing-jcachefrom
feat/cache-tracing-console-sample
Open

feat(samples): [Cache Tracing 6] Add JCache console sample#5182
adinauer wants to merge 5 commits intofeat/cache-tracing-jcachefrom
feat/cache-tracing-console-sample

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Mar 10, 2026

PR Stack (Cache Tracing)

  • #5172 — Add SentryCacheWrapper and SentryCacheManagerWrapper
  • #5173 — Add enableCacheTracing option
  • #5174 — Add BeanPostProcessor and auto-configuration
  • #5175 — Add cache tracing e2e sample
  • #5179 — Add SentryJCacheWrapper for JCache (JSR-107)
  • #5182 — Add JCache console sample
  • #5183 — Add cache tracing to all Spring Boot 4 samples
  • #5184 — Add retrieve() overrides for reactive/async cache support

📜 Description

Adds a JCache (JSR-107) cache tracing demonstration to the console sample app. Shows how to manually wrap a JCache Cache with SentryJCacheWrapper to create cache.get, cache.put, cache.remove, and cache.flush spans as children of the active transaction.

Changes:

  • Added caffeine-jcache dependency to libs.versions.toml (Caffeine as the JCache provider for the sample)
  • Added sentryJcache, jcache, and caffeine-jcache dependencies to the console sample
  • Added demonstrateCacheTracing() method to Main.java demonstrating put, get (hit), get (miss), remove, and clear operations

💡 Motivation and Context

Provides a working example of manual JCache cache tracing for developers who want to use SentryJCacheWrapper directly without Spring auto-configuration.

💚 How did you test it?

Ran the console sample locally and verified cache spans appear in the transaction.

📝 Checklist

  • I added GH Issue ID & Linear ID
  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • Review from the native team if needed.
  • No breaking change or entry added to the changelog.
  • No breaking change for hybrid SDKs or communicated to hybrid SDKs.

🔮 Next steps

  • Documentation PR
  • Release registry PR
  • Auto-install in Gradle/Maven plugins PR

⚠️ Merge this PR using a merge commit (not squash). Only the collection branch is squash-merged into main.

#skip-changelog

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Semver Impact of This PR

🟡 Minor (new features)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


This PR will not appear in the changelog.


🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Generated by 🚫 dangerJS against a3b5eb4

@github-actions
Copy link
Contributor

github-actions bot commented Mar 10, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 321.84 ms 398.02 ms 76.18 ms
Size 0 B 0 B 0 B

Baseline results on branch: feat/cache-tracing-jcache

Startup times

Revision Plain With Sentry Diff
bff862e 315.13 ms 364.41 ms 49.28 ms
10c6fa4 308.73 ms 384.38 ms 75.66 ms
290c35b 320.64 ms 355.09 ms 34.45 ms
c3caf85 313.96 ms 352.98 ms 39.02 ms

App size

Revision Plain With Sentry Diff
bff862e 0 B 0 B 0 B
10c6fa4 0 B 0 B 0 B
290c35b 0 B 0 B 0 B
c3caf85 0 B 0 B 0 B

Previous results on branch: feat/cache-tracing-console-sample

Startup times

Revision Plain With Sentry Diff
d20d0a3 327.43 ms 392.82 ms 65.38 ms

App size

Revision Plain With Sentry Diff
d20d0a3 0 B 0 B 0 B

@sentry
Copy link

sentry bot commented Mar 10, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@sentry
Copy link

sentry bot commented Mar 10, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@sentry
Copy link

sentry bot commented Mar 10, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@sentry
Copy link

sentry bot commented Mar 10, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@sentry
Copy link

sentry bot commented Mar 10, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.1 (1) release

@adinauer
Copy link
Member Author

@sentry review

@adinauer
Copy link
Member Author

cursor review

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

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.

1 participant