Skip to content

feat(samples): [Cache Tracing 5] Add Caffeine cache to Spring Boot sample#5171

Closed
adinauer wants to merge 1 commit intofeat/cache-tracing-samplefrom
feat/cache-tracing-redis-sample
Closed

feat(samples): [Cache Tracing 5] Add Caffeine cache to Spring Boot sample#5171
adinauer wants to merge 1 commit intofeat/cache-tracing-samplefrom
feat/cache-tracing-redis-sample

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Mar 9, 2026

PR Stack (Cache Tracing)

  • #5162 — Add SentryCacheWrapper and SentryCacheManagerWrapper
  • #5163 — Add enableCacheTracing option
  • #5164 — Add BeanPostProcessor and auto-configuration
  • #5167 — Add cache tracing e2e sample
  • #5171 — Add Caffeine cache to Spring Boot sample

📜 Description

Adds Caffeine-backed caching to the Spring Boot 2/3 sample app to demonstrate cache tracing without external infrastructure (no Redis/Docker needed).

  • Adds com.github.ben-manes.caffeine:caffeine dependency (version managed by Spring Boot BOM)
  • Enables @EnableCaching on the application
  • Configures sentry.enable-cache-tracing=true and Caffeine cache spec in application.properties

💡 Motivation and Context

The Spring Boot 4 sample uses ConcurrentMapCacheManager for cache tracing. This PR adds a more realistic cache provider (Caffeine with TTL and size limits) to the Spring Boot 2/3 sample, while keeping it zero-infrastructure.

💚 How did you test it?

  • Verified the sample app starts and compiles successfully
  • Cache endpoints (/cache/) work with Caffeine as the backing store

📝 Checklist

  • I added tests to verify the changes.
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled.
  • No breaking change or entry added to the changelog.

🔮 Next steps

#skip-changelog

Enable cache tracing in the Spring Boot 2/3 sample using Caffeine
as an in-memory cache provider. No external infrastructure required.

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

github-actions bot commented Mar 9, 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 9, 2026

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

Generated by 🚫 dangerJS against 0a6da6f

@sentry
Copy link

sentry bot commented Mar 9, 2026

Sentry Build Distribution

App Version Configuration
SDK Size 8.34.0 (1) release

@adinauer adinauer closed this Mar 9, 2026
@github-actions
Copy link
Contributor

github-actions bot commented Mar 9, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 351.81 ms 425.08 ms 73.27 ms
Size 0 B 0 B 0 B

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

Startup times

Revision Plain With Sentry Diff
b2b863f 338.62 ms 376.54 ms 37.92 ms

App size

Revision Plain With Sentry Diff
b2b863f 0 B 0 B 0 B

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