From b748ec3c8721d141474276742e9132f2d52e687f Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 17 Mar 2026 06:57:51 +0100 Subject: [PATCH 01/10] docs(java): Add cache tracing integration pages Add integration pages for JCache, Caffeine, Ehcache, and Redis cache tracing. For Spring Boot users, each page documents the `sentry.enable-cache-tracing` option. For plain Java users, pages link to the JCache integration which uses `SentryJCacheWrapper`. Also adds the `enableCacheTracing` option to the configuration options reference. Co-Authored-By: Claude Opus 4.6 (1M context) --- .../java/common/configuration/options.mdx | 8 ++ .../java/common/integrations/caffeine.mdx | 59 ++++++++++ .../java/common/integrations/ehcache.mdx | 59 ++++++++++ .../java/common/integrations/jcache.mdx | 108 ++++++++++++++++++ .../java/common/integrations/redis.mdx | 81 +++++++++++++ 5 files changed, 315 insertions(+) create mode 100644 docs/platforms/java/common/integrations/caffeine.mdx create mode 100644 docs/platforms/java/common/integrations/ehcache.mdx create mode 100644 docs/platforms/java/common/integrations/jcache.mdx create mode 100644 docs/platforms/java/common/integrations/redis.mdx diff --git a/docs/platforms/java/common/configuration/options.mdx b/docs/platforms/java/common/configuration/options.mdx index 68022111be1ad..af2a3eb61e3cb 100644 --- a/docs/platforms/java/common/configuration/options.mdx +++ b/docs/platforms/java/common/configuration/options.mdx @@ -297,6 +297,14 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti + + +Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (`@Cacheable`, `@CachePut`, `@CacheEvict`). This is opt-in because cache operations can be high-volume, especially with in-memory caches. + +In Spring Boot, set `sentry.enable-cache-tracing=true` in `application.properties`. + + + ## Profiling Options diff --git a/docs/platforms/java/common/integrations/caffeine.mdx b/docs/platforms/java/common/integrations/caffeine.mdx new file mode 100644 index 0000000000000..6eb5fc1235558 --- /dev/null +++ b/docs/platforms/java/common/integrations/caffeine.mdx @@ -0,0 +1,59 @@ +--- +title: Caffeine Integration +description: "Learn how to trace Caffeine cache operations with Sentry." +--- + +Sentry can trace cache operations performed by [Caffeine](https://github.com/ben-manes/caffeine), the high-performance in-memory caching library for Java. Cache spans appear in Sentry's [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/). + + + +## Spring Boot + +If you're using Caffeine as your Spring Boot cache provider, cache tracing is built into the Sentry Spring Boot starter. Enable it in your configuration: + +```properties {tabTitle:application.properties} +sentry.enable-cache-tracing=true +sentry.traces-sample-rate=1.0 +``` + +```yaml {tabTitle:application.yml} +sentry: + enable-cache-tracing: true + traces-sample-rate: 1.0 +``` + +All `@Cacheable`, `@CachePut`, and `@CacheEvict` operations will automatically produce Sentry spans — no additional dependencies or code changes required. + +See `enableCacheTracing` for more details on this option. + + + + + +## Plain Java + +Caffeine provides a [JCache (JSR-107) adapter](https://github.com/ben-manes/caffeine/wiki/JCache). Use it together with the Sentry JCache integration to trace cache operations. + +Add the dependencies: + +```groovy {tabTitle:Gradle} +implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' +implementation 'com.github.ben-manes.caffeine:jcache:3.2.0' +``` + +```xml {tabTitle:Maven} + + io.sentry + sentry-jcache + {{@inject packages.version('sentry.java.jcache', '8.35.0') }} + + + com.github.ben-manes.caffeine + jcache + 3.2.0 + +``` + +Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. + + diff --git a/docs/platforms/java/common/integrations/ehcache.mdx b/docs/platforms/java/common/integrations/ehcache.mdx new file mode 100644 index 0000000000000..797b43542a604 --- /dev/null +++ b/docs/platforms/java/common/integrations/ehcache.mdx @@ -0,0 +1,59 @@ +--- +title: Ehcache Integration +description: "Learn how to trace Ehcache cache operations with Sentry." +--- + +Sentry can trace cache operations performed by [Ehcache](https://www.ehcache.org/), a widely-used Java caching library. Cache spans appear in Sentry's [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/). + + + +## Spring Boot + +If you're using Ehcache as your Spring Boot cache provider, cache tracing is built into the Sentry Spring Boot starter. Enable it in your configuration: + +```properties {tabTitle:application.properties} +sentry.enable-cache-tracing=true +sentry.traces-sample-rate=1.0 +``` + +```yaml {tabTitle:application.yml} +sentry: + enable-cache-tracing: true + traces-sample-rate: 1.0 +``` + +All `@Cacheable`, `@CachePut`, and `@CacheEvict` operations will automatically produce Sentry spans — no additional dependencies or code changes required. + +See `enableCacheTracing` for more details on this option. + + + + + +## Plain Java + +Ehcache 3 implements the [JCache (JSR-107)](https://www.ehcache.org/documentation/3.0/107.html) API natively. Use it together with the Sentry JCache integration to trace cache operations. + +Add the dependencies: + +```groovy {tabTitle:Gradle} +implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' +implementation 'org.ehcache:ehcache:3.10.8' +``` + +```xml {tabTitle:Maven} + + io.sentry + sentry-jcache + {{@inject packages.version('sentry.java.jcache', '8.35.0') }} + + + org.ehcache + ehcache + 3.10.8 + +``` + +Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. + + diff --git a/docs/platforms/java/common/integrations/jcache.mdx b/docs/platforms/java/common/integrations/jcache.mdx new file mode 100644 index 0000000000000..603119b3063c1 --- /dev/null +++ b/docs/platforms/java/common/integrations/jcache.mdx @@ -0,0 +1,108 @@ +--- +title: JCache Integration +description: "Learn how to trace cache operations using the Sentry JCache (JSR-107) integration." +--- + +Sentry's [JCache (JSR-107)](https://www.jcp.org/en/jsr/detail?id=107) integration automatically creates spans for cache operations like `get`, `put`, `remove`, and `clear`. It works with any JCache provider (Caffeine, Ehcache, Hazelcast, etc.). + +Cache spans appear in Sentry's [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/). + + + +If you're using Spring Boot with `@Cacheable` / `@CachePut` / `@CacheEvict`, you don't need this integration — cache tracing is built into the Spring Boot starter. Just enable the `enableCacheTracing` option (or set `sentry.enable-cache-tracing=true` in `application.properties`) and all Spring Cache operations will be traced automatically. + + + +## Install + +```groovy {tabTitle:Gradle} +implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' +``` + +```xml {tabTitle:Maven} + + io.sentry + sentry-jcache + {{@inject packages.version('sentry.java.jcache', '8.35.0') }} + +``` + +```scala {tabTitle: SBT} +libraryDependencies += "io.sentry" % "sentry-jcache" % "{{@inject packages.version('sentry.java.jcache', '8.35.0') }}" +``` + +For other dependency managers, check out the [central Maven repository](https://search.maven.org/artifact/io.sentry/sentry-jcache). + +## Set Up + +Enable cache tracing in your Sentry configuration: + +```java +Sentry.init(options -> { + options.setDsn("___DSN___"); + options.setTracesSampleRate(1.0); + options.setEnableCacheTracing(true); +}); +``` + +Wrap your `javax.cache.Cache` instance with `SentryJCacheWrapper`: + +```java +import io.sentry.jcache.SentryJCacheWrapper; +import javax.cache.Cache; +import javax.cache.CacheManager; +import javax.cache.Caching; +import javax.cache.spi.CachingProvider; + +CachingProvider provider = Caching.getCachingProvider(); +CacheManager manager = provider.getCacheManager(); + +Cache cache = manager.getCache("myCache"); +Cache sentryCache = new SentryJCacheWrapper<>(cache); + +// Use sentryCache — all operations produce Sentry spans +sentryCache.put("key", "value"); // cache.put span +String val = sentryCache.get("key"); // cache.get span (cache.hit = true) +sentryCache.remove("key"); // cache.remove span +sentryCache.clear(); // cache.flush span +``` + +## Traced Operations + +| JCache Method(s) | Span Op | +|---|---| +| `get`, `getAll`, `invoke`, `invokeAll` | `cache.get` | +| `put`, `getAndPut`, `putAll` | `cache.put` | +| `remove`, `getAndRemove`, `removeAll(keys)` | `cache.remove` | +| `clear`, `removeAll()` | `cache.flush` | + +Conditional writes — `putIfAbsent`, `replace`, `getAndReplace` — are **not** traced because the outcome (write vs no-op) is not known ahead of time. + +## Span Data + +| Key | Type | Description | +|---|---|---| +| `cache.hit` | boolean | Whether the cache lookup returned a value (`cache.get` spans only) | +| `cache.key` | list of strings | The cache key(s) involved in the operation | + +Bulk operations (`getAll`, `putAll`, `removeAll`) create a single span with all keys listed in `cache.key`. + +## Verify + +To verify, trigger a cache operation within an active transaction and check the [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/) or the trace view in Sentry. + +```java +import io.sentry.Sentry; + +Sentry.startNewTrace(); +ITransactionContext txCtx = new TransactionContext("test-cache", "task"); +ITransaction tx = Sentry.startTransaction(txCtx); +Sentry.getCurrentScopes().getScope().setTransaction(tx); + +try { + sentryCache.put("greeting", "hello"); + String value = sentryCache.get("greeting"); +} finally { + tx.finish(); +} +``` diff --git a/docs/platforms/java/common/integrations/redis.mdx b/docs/platforms/java/common/integrations/redis.mdx new file mode 100644 index 0000000000000..f651a4cac7afe --- /dev/null +++ b/docs/platforms/java/common/integrations/redis.mdx @@ -0,0 +1,81 @@ +--- +title: Redis Integration +description: "Learn how to trace Redis cache operations with Sentry." +--- + +Sentry can trace cache operations performed through [Redis](https://redis.io/) using Jedis or Lettuce as the client library. Cache spans appear in Sentry's [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/). + + + +## Spring Boot + +If you're using Redis (via Spring Data Redis with Jedis or Lettuce) as your Spring Boot cache provider, cache tracing is built into the Sentry Spring Boot starter. Enable it in your configuration: + +```properties {tabTitle:application.properties} +sentry.enable-cache-tracing=true +sentry.traces-sample-rate=1.0 +``` + +```yaml {tabTitle:application.yml} +sentry: + enable-cache-tracing: true + traces-sample-rate: 1.0 +``` + +All `@Cacheable`, `@CachePut`, and `@CacheEvict` operations will automatically produce Sentry spans — no additional dependencies or code changes required. + +See `enableCacheTracing` for more details on this option. + + + + + +## Plain Java + +Both Jedis and Lettuce provide [JCache (JSR-107)](https://github.com/redis/jedis/wiki/JCache-Support) adapters. Use them together with the Sentry JCache integration to trace cache operations. + +Add the dependencies for your Redis client: + +### Jedis + +```groovy {tabTitle:Gradle} +implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' +implementation 'redis.clients:jedis:5.2.0' +``` + +```xml {tabTitle:Maven} + + io.sentry + sentry-jcache + {{@inject packages.version('sentry.java.jcache', '8.35.0') }} + + + redis.clients + jedis + 5.2.0 + +``` + +### Lettuce + +```groovy {tabTitle:Gradle} +implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' +implementation 'io.lettuce:lettuce-core:6.5.5.RELEASE' +``` + +```xml {tabTitle:Maven} + + io.sentry + sentry-jcache + {{@inject packages.version('sentry.java.jcache', '8.35.0') }} + + + io.lettuce + lettuce-core + 6.5.5.RELEASE + +``` + +Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. + + From a0df112fa60b7b75f2ff1a54db59cb1468f40eff Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 17 Mar 2026 07:10:07 +0100 Subject: [PATCH 02/10] docs(java): Simplify verify snippet in jcache.mdx Use Sentry.startTransaction(name, op) with tx.makeCurrent() in try-with-resources instead of verbose TransactionContext + manual scope binding. Co-Authored-By: Claude --- docs/platforms/java/common/integrations/jcache.mdx | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/docs/platforms/java/common/integrations/jcache.mdx b/docs/platforms/java/common/integrations/jcache.mdx index 603119b3063c1..e81266f3eeda5 100644 --- a/docs/platforms/java/common/integrations/jcache.mdx +++ b/docs/platforms/java/common/integrations/jcache.mdx @@ -92,14 +92,11 @@ Bulk operations (`getAll`, `putAll`, `removeAll`) create a single span with all To verify, trigger a cache operation within an active transaction and check the [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/) or the trace view in Sentry. ```java +import io.sentry.ITransaction; import io.sentry.Sentry; -Sentry.startNewTrace(); -ITransactionContext txCtx = new TransactionContext("test-cache", "task"); -ITransaction tx = Sentry.startTransaction(txCtx); -Sentry.getCurrentScopes().getScope().setTransaction(tx); - -try { +ITransaction tx = Sentry.startTransaction("test-cache", "task"); +try (ISentryLifecycleToken ignored = tx.makeCurrent()) { sentryCache.put("greeting", "hello"); String value = sentryCache.get("greeting"); } finally { From 5a03ddc608c7b7c6eca5c4d99462aa49bf04e61c Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 17 Mar 2026 07:12:14 +0100 Subject: [PATCH 03/10] docs(java): Add Kotlin snippets to jcache.mdx Add tabbed Kotlin alternatives alongside all Java code snippets for init, setup, and verify sections. Co-Authored-By: Claude --- .../java/common/integrations/jcache.mdx | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/docs/platforms/java/common/integrations/jcache.mdx b/docs/platforms/java/common/integrations/jcache.mdx index e81266f3eeda5..36280d25d8fd6 100644 --- a/docs/platforms/java/common/integrations/jcache.mdx +++ b/docs/platforms/java/common/integrations/jcache.mdx @@ -37,7 +37,7 @@ For other dependency managers, check out the [central Maven repository](https:// Enable cache tracing in your Sentry configuration: -```java +```java {tabTitle:Java} Sentry.init(options -> { options.setDsn("___DSN___"); options.setTracesSampleRate(1.0); @@ -45,9 +45,17 @@ Sentry.init(options -> { }); ``` +```kotlin {tabTitle:Kotlin} +Sentry.init { options -> + options.dsn = "___DSN___" + options.tracesSampleRate = 1.0 + options.isEnableCacheTracing = true +} +``` + Wrap your `javax.cache.Cache` instance with `SentryJCacheWrapper`: -```java +```java {tabTitle:Java} import io.sentry.jcache.SentryJCacheWrapper; import javax.cache.Cache; import javax.cache.CacheManager; @@ -67,6 +75,23 @@ sentryCache.remove("key"); // cache.remove span sentryCache.clear(); // cache.flush span ``` +```kotlin {tabTitle:Kotlin} +import io.sentry.jcache.SentryJCacheWrapper +import javax.cache.Caching + +val provider = Caching.getCachingProvider() +val manager = provider.cacheManager + +val cache = manager.getCache("myCache") +val sentryCache = SentryJCacheWrapper(cache) + +// Use sentryCache — all operations produce Sentry spans +sentryCache.put("key", "value") // cache.put span +val value = sentryCache.get("key") // cache.get span (cache.hit = true) +sentryCache.remove("key") // cache.remove span +sentryCache.clear() // cache.flush span +``` + ## Traced Operations | JCache Method(s) | Span Op | @@ -91,7 +116,7 @@ Bulk operations (`getAll`, `putAll`, `removeAll`) create a single span with all To verify, trigger a cache operation within an active transaction and check the [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/) or the trace view in Sentry. -```java +```java {tabTitle:Java} import io.sentry.ITransaction; import io.sentry.Sentry; @@ -103,3 +128,14 @@ try (ISentryLifecycleToken ignored = tx.makeCurrent()) { tx.finish(); } ``` + +```kotlin {tabTitle:Kotlin} +import io.sentry.Sentry + +val tx = Sentry.startTransaction("test-cache", "task") +tx.makeCurrent().use { + sentryCache.put("greeting", "hello") + val value = sentryCache.get("greeting") +} +tx.finish() +``` From bb0d5232c302591a0e19f377a86bfe186743605b Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 17 Mar 2026 15:20:35 +0100 Subject: [PATCH 04/10] Apply suggestion from @adinauer --- docs/platforms/java/common/configuration/options.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/java/common/configuration/options.mdx b/docs/platforms/java/common/configuration/options.mdx index af2a3eb61e3cb..6b75f455810d2 100644 --- a/docs/platforms/java/common/configuration/options.mdx +++ b/docs/platforms/java/common/configuration/options.mdx @@ -299,7 +299,7 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti -Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (`@Cacheable`, `@CachePut`, `@CacheEvict`). This is opt-in because cache operations can be high-volume, especially with in-memory caches. +Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (`@Cacheable`, `@CachePut`, `@CacheEvict`). In Spring Boot, set `sentry.enable-cache-tracing=true` in `application.properties`. From 3df48724cec77f37dbf1f41bfcfb280bb3b6cf84 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Tue, 17 Mar 2026 15:23:53 +0100 Subject: [PATCH 05/10] remove spring boot config sentence from option --- docs/platforms/java/common/configuration/options.mdx | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/platforms/java/common/configuration/options.mdx b/docs/platforms/java/common/configuration/options.mdx index 6b75f455810d2..73849c33c8ca4 100644 --- a/docs/platforms/java/common/configuration/options.mdx +++ b/docs/platforms/java/common/configuration/options.mdx @@ -301,8 +301,6 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (`@Cacheable`, `@CachePut`, `@CacheEvict`). -In Spring Boot, set `sentry.enable-cache-tracing=true` in `application.properties`. - ## Profiling Options From 08fd094659dba55238eccb65b56c5f69a778226c Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Wed, 18 Mar 2026 14:42:42 +0100 Subject: [PATCH 06/10] docs(java): Update JCache traced operations and span data MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace the inaccurate consolidated span op table (which mapped groups of methods to four generic ops) with a single sentence stating that each method produces a cache. span. Remove the incorrect claim that conditional writes (putIfAbsent, replace, getAndReplace) are not traced — they are traced, and cache.write reflects the actual outcome. Add cache.operation and cache.write to the Span Data table. Fix the cache.clear code example comment which incorrectly said "cache.flush span". Co-Authored-By: Claude --- .../java/common/integrations/jcache.mdx | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/docs/platforms/java/common/integrations/jcache.mdx b/docs/platforms/java/common/integrations/jcache.mdx index 36280d25d8fd6..536819da457cf 100644 --- a/docs/platforms/java/common/integrations/jcache.mdx +++ b/docs/platforms/java/common/integrations/jcache.mdx @@ -72,7 +72,7 @@ Cache sentryCache = new SentryJCacheWrapper<>(cache); sentryCache.put("key", "value"); // cache.put span String val = sentryCache.get("key"); // cache.get span (cache.hit = true) sentryCache.remove("key"); // cache.remove span -sentryCache.clear(); // cache.flush span +sentryCache.clear(); // cache.clear span ``` ```kotlin {tabTitle:Kotlin} @@ -89,26 +89,21 @@ val sentryCache = SentryJCacheWrapper(cache) sentryCache.put("key", "value") // cache.put span val value = sentryCache.get("key") // cache.get span (cache.hit = true) sentryCache.remove("key") // cache.remove span -sentryCache.clear() // cache.flush span +sentryCache.clear() // cache.clear span ``` ## Traced Operations -| JCache Method(s) | Span Op | -|---|---| -| `get`, `getAll`, `invoke`, `invokeAll` | `cache.get` | -| `put`, `getAndPut`, `putAll` | `cache.put` | -| `remove`, `getAndRemove`, `removeAll(keys)` | `cache.remove` | -| `clear`, `removeAll()` | `cache.flush` | - -Conditional writes — `putIfAbsent`, `replace`, `getAndReplace` — are **not** traced because the outcome (write vs no-op) is not known ahead of time. +All JCache operations are traced. Each method creates a span with the operation `cache.` (e.g. `cache.get`, `cache.putIfAbsent`, `cache.removeAll`). ## Span Data | Key | Type | Description | |---|---|---| -| `cache.hit` | boolean | Whether the cache lookup returned a value (`cache.get` spans only) | +| `cache.hit` | boolean | Whether the cache lookup returned a value (read spans only) | | `cache.key` | list of strings | The cache key(s) involved in the operation | +| `cache.operation` | string | The JCache method name (e.g. `get`, `putIfAbsent`, `removeAll`) | +| `cache.write` | boolean | Whether the operation modified the cache. Always `true` for unconditional writes (`put`, `putAll`, `remove`, `clear`); reflects the actual outcome for conditional operations (`putIfAbsent`, `replace`, `getAndReplace`) and value-matched removes | Bulk operations (`getAll`, `putAll`, `removeAll`) create a single span with all keys listed in `cache.key`. From 8bef9b385e936b9415b7c273f544666adf3080ce Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 30 Mar 2026 13:05:31 +0200 Subject: [PATCH 07/10] Apply suggestion from @adinauer --- docs/platforms/java/common/configuration/options.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/java/common/configuration/options.mdx b/docs/platforms/java/common/configuration/options.mdx index 73849c33c8ca4..75e803b2bccee 100644 --- a/docs/platforms/java/common/configuration/options.mdx +++ b/docs/platforms/java/common/configuration/options.mdx @@ -299,7 +299,7 @@ Set this boolean to `false` to disable tracing for `OPTIONS` requests. This opti -Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (`@Cacheable`, `@CachePut`, `@CacheEvict`). +Whether cache operations (`get`, `put`, `remove`, `flush`) should be traced. When enabled, the SDK creates spans for cache operations performed through the JCache integration or Spring Cache (e.g. `@Cacheable`, `@CachePut`, `@CacheEvict`). From 8d6fdb7377c436107e92e7ee1305a029d8b67c72 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 30 Mar 2026 13:09:50 +0200 Subject: [PATCH 08/10] docs(java): Remove incorrect Lettuce JCache adapter claim Lettuce does not provide a JCache (JSR-107) adapter, so the Plain Java section incorrectly claimed both Jedis and Lettuce support JCache. Users following the Lettuce instructions would fail at runtime when no CachingProvider is found on the classpath. Remove the Lettuce dependency section from Plain Java and add a note clarifying that JCache-based tracing only works with Jedis. Lettuce users are directed to the Spring Boot integration instead. Co-Authored-By: Claude --- .../java/common/integrations/redis.mdx | 30 +++++-------------- 1 file changed, 7 insertions(+), 23 deletions(-) diff --git a/docs/platforms/java/common/integrations/redis.mdx b/docs/platforms/java/common/integrations/redis.mdx index f651a4cac7afe..d2806946ed0fa 100644 --- a/docs/platforms/java/common/integrations/redis.mdx +++ b/docs/platforms/java/common/integrations/redis.mdx @@ -32,11 +32,15 @@ See `enableCacheTr ## Plain Java -Both Jedis and Lettuce provide [JCache (JSR-107)](https://github.com/redis/jedis/wiki/JCache-Support) adapters. Use them together with the Sentry JCache integration to trace cache operations. +Jedis provides a [JCache (JSR-107)](https://github.com/redis/jedis/wiki/JCache-Support) adapter. Use it together with the Sentry JCache integration to trace cache operations. -Add the dependencies for your Redis client: + -### Jedis +Lettuce does not provide a JCache adapter, so the JCache-based approach described here only works with Jedis. For Lettuce-based cache tracing, use Spring Boot with Spring Data Redis (see above). + + + +Add the required dependencies: ```groovy {tabTitle:Gradle} implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' @@ -56,26 +60,6 @@ implementation 'redis.clients:jedis:5.2.0' ``` -### Lettuce - -```groovy {tabTitle:Gradle} -implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' -implementation 'io.lettuce:lettuce-core:6.5.5.RELEASE' -``` - -```xml {tabTitle:Maven} - - io.sentry - sentry-jcache - {{@inject packages.version('sentry.java.jcache', '8.35.0') }} - - - io.lettuce - lettuce-core - 6.5.5.RELEASE - -``` - Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. From 104c964445f43cda61f19cb2780f8362fe5da423 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 30 Mar 2026 13:41:31 +0200 Subject: [PATCH 09/10] docs(java): Remove incorrect Lettuce JCache adapter claim Lettuce does not provide a JCache (JSR-107) adapter, so the Plain Java section incorrectly claimed both Jedis and Lettuce support JCache. Users following the Lettuce instructions would fail at runtime when no CachingProvider is found on the classpath. Remove the Lettuce dependency section from Plain Java and add an alert clarifying that JCache-based tracing only works with Jedis. Lettuce users are directed to the Spring Boot integration instead. Co-Authored-By: Claude --- docs/platforms/java/common/integrations/redis.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/platforms/java/common/integrations/redis.mdx b/docs/platforms/java/common/integrations/redis.mdx index d2806946ed0fa..e77477c14c414 100644 --- a/docs/platforms/java/common/integrations/redis.mdx +++ b/docs/platforms/java/common/integrations/redis.mdx @@ -34,11 +34,11 @@ See `enableCacheTr Jedis provides a [JCache (JSR-107)](https://github.com/redis/jedis/wiki/JCache-Support) adapter. Use it together with the Sentry JCache integration to trace cache operations. - + -Lettuce does not provide a JCache adapter, so the JCache-based approach described here only works with Jedis. For Lettuce-based cache tracing, use Spring Boot with Spring Data Redis (see above). +Lettuce does not provide a JCache adapter, so the JCache-based approach described here only works with Jedis. For Lettuce-based cache tracing, use Spring Boot with Spring Data Redis. - + Add the required dependencies: From be7056f690f4b73f4c2a9376cb5fe58989c52e81 Mon Sep 17 00:00:00 2001 From: Alexander Dinauer Date: Mon, 30 Mar 2026 17:09:41 +0200 Subject: [PATCH 10/10] docs(java): Remove duplicate dependency snippets and add missing import Remove third-party cache library dependency snippets from Caffeine, Ehcache, and Redis pages. These versions go stale and the JCache integration page already covers the sentry-jcache dependency. Each provider page now links to the JCache docs instead. Add missing ISentryLifecycleToken import in the JCache verify example. Co-Authored-By: Claude --- .../java/common/integrations/caffeine.mdx | 22 ------------------- .../java/common/integrations/ehcache.mdx | 22 ------------------- .../java/common/integrations/jcache.mdx | 1 + .../java/common/integrations/redis.mdx | 22 ------------------- 4 files changed, 1 insertion(+), 66 deletions(-) diff --git a/docs/platforms/java/common/integrations/caffeine.mdx b/docs/platforms/java/common/integrations/caffeine.mdx index 6eb5fc1235558..23dae776bd4aa 100644 --- a/docs/platforms/java/common/integrations/caffeine.mdx +++ b/docs/platforms/java/common/integrations/caffeine.mdx @@ -34,26 +34,4 @@ See `enableCacheTr Caffeine provides a [JCache (JSR-107) adapter](https://github.com/ben-manes/caffeine/wiki/JCache). Use it together with the Sentry JCache integration to trace cache operations. -Add the dependencies: - -```groovy {tabTitle:Gradle} -implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' -implementation 'com.github.ben-manes.caffeine:jcache:3.2.0' -``` - -```xml {tabTitle:Maven} - - io.sentry - sentry-jcache - {{@inject packages.version('sentry.java.jcache', '8.35.0') }} - - - com.github.ben-manes.caffeine - jcache - 3.2.0 - -``` - -Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. - diff --git a/docs/platforms/java/common/integrations/ehcache.mdx b/docs/platforms/java/common/integrations/ehcache.mdx index 797b43542a604..fad6458d96c60 100644 --- a/docs/platforms/java/common/integrations/ehcache.mdx +++ b/docs/platforms/java/common/integrations/ehcache.mdx @@ -34,26 +34,4 @@ See `enableCacheTr Ehcache 3 implements the [JCache (JSR-107)](https://www.ehcache.org/documentation/3.0/107.html) API natively. Use it together with the Sentry JCache integration to trace cache operations. -Add the dependencies: - -```groovy {tabTitle:Gradle} -implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' -implementation 'org.ehcache:ehcache:3.10.8' -``` - -```xml {tabTitle:Maven} - - io.sentry - sentry-jcache - {{@inject packages.version('sentry.java.jcache', '8.35.0') }} - - - org.ehcache - ehcache - 3.10.8 - -``` - -Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. - diff --git a/docs/platforms/java/common/integrations/jcache.mdx b/docs/platforms/java/common/integrations/jcache.mdx index 536819da457cf..41b1e1c7afe6b 100644 --- a/docs/platforms/java/common/integrations/jcache.mdx +++ b/docs/platforms/java/common/integrations/jcache.mdx @@ -112,6 +112,7 @@ Bulk operations (`getAll`, `putAll`, `removeAll`) create a single span with all To verify, trigger a cache operation within an active transaction and check the [Caches dashboard](https://sentry.io/orgredirect/organizations/:orgslug/insights/backend/caches/) or the trace view in Sentry. ```java {tabTitle:Java} +import io.sentry.ISentryLifecycleToken; import io.sentry.ITransaction; import io.sentry.Sentry; diff --git a/docs/platforms/java/common/integrations/redis.mdx b/docs/platforms/java/common/integrations/redis.mdx index e77477c14c414..2c604654a38df 100644 --- a/docs/platforms/java/common/integrations/redis.mdx +++ b/docs/platforms/java/common/integrations/redis.mdx @@ -40,26 +40,4 @@ Lettuce does not provide a JCache adapter, so the JCache-based approach describe -Add the required dependencies: - -```groovy {tabTitle:Gradle} -implementation 'io.sentry:sentry-jcache:{{@inject packages.version('sentry.java.jcache', '8.35.0') }}' -implementation 'redis.clients:jedis:5.2.0' -``` - -```xml {tabTitle:Maven} - - io.sentry - sentry-jcache - {{@inject packages.version('sentry.java.jcache', '8.35.0') }} - - - redis.clients - jedis - 5.2.0 - -``` - -Then wrap your cache with `SentryJCacheWrapper`. See the JCache integration docs for setup and usage details. -