-
-
Notifications
You must be signed in to change notification settings - Fork 468
feat(spring): Cache Tracing #5165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 95 commits
Commits
Show all changes
100 commits
Select commit
Hold shift + click to select a range
8925435
feat(spring): [Cache Tracing 1] Add SentryCacheWrapper and SentryCach…
adinauer 6e4ede5
Merge branch 'main' into feat/cache-tracing-wrappers
adinauer 7735a81
collection: Cache Tracing
adinauer 6d6f5eb
Merge branch 'feat/cache-tracing' into feat/cache-tracing-wrappers
adinauer da5bde0
fix(cache): Fix span description, putIfAbsent, and Callable hit detec…
adinauer 5e081fc
feat(core): [Cache Tracing 2] Add enableCacheTracing option
adinauer 3815908
feat(spring): [Cache Tracing 3] Add BeanPostProcessor and auto-config…
adinauer 84f4889
changelog
adinauer fc79424
fix: Update changelog PR references
adinauer ae0f569
feat(samples): [Cache Tracing 4] Add cache tracing e2e sample
adinauer cf3b325
ref(samples): Replace ConcurrentMapCacheManager with Caffeine
adinauer 7c54933
fix dependencies; move to toml
adinauer ffb6ae4
Merge remote-tracking branch 'origin/main' into feat/cache-tracing
adinauer 94ae0e1
Merge branch 'feat/cache-tracing' into feat/cache-tracing-wrappers
adinauer 50c1206
Merge branch 'feat/cache-tracing-wrappers' into feat/cache-tracing-op…
adinauer 6add6e1
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer 1afb20e
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer 6822d8a
feat(jcache): Add SentryJCacheWrapper for JCache (JSR-107) cache tracing
adinauer 4b6759d
changelog
adinauer 93be5c8
fix(jcache): Make replace and getAndReplace passthrough (no span)
adinauer 038e792
fix(jcache): Check for NoOp span after startChild
adinauer 0d4de4b
fix(jcache): Use cache.flush for removeAll() without keys
adinauer 8434b4e
feat(samples): Add JCache cache tracing demo to console sample
adinauer 8be4571
changelog
adinauer d55c8fa
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer ebb8ee1
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer 7453d68
changelog
adinauer 5059f9a
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer 89a572d
fix(core): Use correct cache span op terminology in Javadoc
adinauer 70ea6d7
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer 1484b6b
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer ba9add7
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer b3c5751
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer c03021a
changelog
adinauer 19eb28b
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer 032ab26
changelog
adinauer 96acd1d
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer 0b1b83a
fix(spring7): Avoid double-wrapping caches in SentryCacheManagerWrapper
adinauer 21f5b1e
Merge branch 'feat/cache-tracing-wrappers' into feat/cache-tracing-op…
adinauer 8d588b2
Merge branch 'feat/cache-tracing-option' into feat/cache-tracing-auto…
adinauer d2c83ac
Merge branch 'feat/cache-tracing-autoconfig' into feat/cache-tracing-…
adinauer bbbb702
Merge branch 'feat/cache-tracing-sample' into feat/cache-tracing-jcache
adinauer a3b5eb4
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing-cons…
adinauer 76a2ecd
feat(samples): Add cache tracing to all Spring Boot 4 samples
adinauer d797a2d
fix(test): Add SENTRY_ENABLE_CACHE_TRACING env var to system test runner
adinauer dbb2998
feat(jcache): Add SentryJCacheWrapper ctor that uses ScopesAdapter
adinauer 41872ad
feat(spring7): Add retrieve() overrides to SentryCacheWrapper
adinauer 4d9f683
feat(spring-jakarta): Add cache tracing for Spring Boot 3 / Spring 6
adinauer 658e082
feat(samples): Add cache tracing to all Spring Boot 3 Jakarta samples
adinauer 7e66a3d
feat(spring): Add cache tracing for Spring Boot 2 / Spring 5
adinauer d5e58b0
feat(samples): Add cache tracing to Spring Boot 2 sample
adinauer 7fa53f7
changelog
adinauer 5a729ca
fix(spring): Skip cache span data when child span is NoOp
adinauer 5d8a445
feat(spring): Add db.operation.name attribute to cache spans
adinauer b8911d9
feat(spring): Instrument putIfAbsent, replace, and getAndReplace cach…
adinauer 2820549
fix(spring): Use ValueWrapper to determine cache hit in typed get
adinauer 4b60cec
docs(jcache): Fix docs link in README
adinauer 4e794ef
ref(spring): Use method-specific span operations for cache spans
adinauer 0a32614
ref(spring): Derive span operation from operationName in startSpan
adinauer 82bc35e
ref(jcache): Merge startSpanForKeys into startSpan overload
adinauer f1dd736
Format code
getsentry-bot bc93435
ref(cache): Move operation attribute to SpanDataConvention as CACHE_O…
adinauer 7426ac7
feat(cache): Add cache.write boolean span attribute
adinauer 867c67e
fix(jcache): Use comma-joined keys as span description for bulk opera…
adinauer 518e465
ref(cache): Remove _KEY suffix from cache SpanDataConvention constants
adinauer 83dfbfa
fix(spring): Fix get(key, type) double-call in SentryCacheWrapper
adinauer f9831a9
fix(samples): Fix cache evict system test to match actual span op
adinauer 72a59c5
Merge pull request #5172 from getsentry/feat/cache-tracing-wrappers
adinauer 10dacf9
Merge pull request #5173 from getsentry/feat/cache-tracing-option
adinauer 2f4eb6b
Merge pull request #5174 from getsentry/feat/cache-tracing-autoconfig
adinauer 4466961
Merge pull request #5175 from getsentry/feat/cache-tracing-sample
adinauer 47a3b5c
Merge pull request #5179 from getsentry/feat/cache-tracing-jcache
adinauer df30083
Merge pull request #5182 from getsentry/feat/cache-tracing-console-sa…
adinauer a23a379
Merge pull request #5183 from getsentry/feat/cache-tracing-all-samples
adinauer 9bc1f3a
assert multiple keys in single assertions
adinauer 638152a
Format code
getsentry-bot 43135e1
Merge branch 'feat/cache-tracing-jcache' into feat/cache-tracing
adinauer 7381353
Merge branch 'feat/cache-tracing-console-sample' into feat/cache-tracing
adinauer 69dad8a
Merge pull request #5184 from getsentry/feat/cache-tracing-retrieve
adinauer 7d0ec4c
Merge pull request #5190 from getsentry/feat/cache-tracing-spring-boot-3
adinauer 09e6e09
Merge pull request #5191 from getsentry/feat/cache-tracing-spring-boot-2
adinauer 9348ff3
Merge pull request #5192 from getsentry/fix/cache-tracing-noop-span
adinauer 8ceba9f
Merge pull request #5201 from getsentry/feat/cache-tracing-db-operati…
adinauer d6d5db5
Merge pull request #5202 from getsentry/feat/cache-tracing-instrument…
adinauer a06700e
Merge pull request #5203 from getsentry/fix/cache-tracing-typed-get-h…
adinauer cb8de20
Merge pull request #5204 from getsentry/ref/cache-tracing-method-spec…
adinauer 49cd9b3
Merge branch 'feat/cache-tracing' into ref/cache-tracing-merge-starts…
adinauer 590c86f
Merge pull request #5205 from getsentry/ref/cache-tracing-merge-start…
adinauer 772b3f6
Merge pull request #5206 from getsentry/ref/cache-tracing-cache-opera…
adinauer 557edb8
Merge pull request #5207 from getsentry/feat/cache-tracing-cache-write
adinauer c44ce1e
Merge pull request #5208 from getsentry/fix/cache-tracing-jcache-bulk…
adinauer fb25fd8
Merge pull request #5209 from getsentry/ref/cache-tracing-rename-cons…
adinauer 36b3bf2
Merge pull request #5210 from getsentry/fix/cache-tracing-typed-get-d…
adinauer d7b3b0b
Merge pull request #5212 from getsentry/fix/cache-tracing-evict-syste…
adinauer 3520857
Merge pull request #5228 from getsentry/feat/cache-tracing-more-revie…
adinauer 3537d84
Merge branch 'main' into feat/cache-tracing
adinauer 616aeab
update PR links in changelog
adinauer cf230cd
fix(spring): [Cache Tracing 24] Track invalidate cache.write accurately
adinauer 21db8da
Merge pull request #5231 from getsentry/fix/cache-tracing-invalidate-…
adinauer 43e78bb
Merge branch 'main' into feat/cache-tracing
adinauer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| # sentry-jcache | ||
|
|
||
| This module provides an integration for JCache (JSR-107). | ||
|
|
||
| JCache is a standard API — you need a provider implementation at runtime. Common implementations include: | ||
|
|
||
| - [Caffeine](https://github.com/ben-manes/caffeine) (via `com.github.ben-manes.caffeine:jcache`) | ||
| - [Ehcache 3](https://www.ehcache.org/) (via `org.ehcache:ehcache`) | ||
| - [Hazelcast](https://hazelcast.com/) | ||
| - [Apache Ignite](https://ignite.apache.org/) | ||
| - [Infinispan](https://infinispan.org/) | ||
|
|
||
| Please consult the documentation on how to install and use this integration in the Sentry Docs for [Java](https://docs.sentry.io/platforms/java/integrations/jcache/). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| public final class io/sentry/jcache/BuildConfig { | ||
| public static final field SENTRY_JCACHE_SDK_NAME Ljava/lang/String; | ||
| public static final field VERSION_NAME Ljava/lang/String; | ||
| } | ||
|
|
||
| public final class io/sentry/jcache/SentryJCacheWrapper : javax/cache/Cache { | ||
| public fun <init> (Ljavax/cache/Cache;)V | ||
| public fun <init> (Ljavax/cache/Cache;Lio/sentry/IScopes;)V | ||
| public fun clear ()V | ||
| public fun close ()V | ||
| public fun containsKey (Ljava/lang/Object;)Z | ||
| public fun deregisterCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V | ||
| public fun get (Ljava/lang/Object;)Ljava/lang/Object; | ||
| public fun getAll (Ljava/util/Set;)Ljava/util/Map; | ||
| public fun getAndPut (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; | ||
| public fun getAndRemove (Ljava/lang/Object;)Ljava/lang/Object; | ||
| public fun getAndReplace (Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object; | ||
| public fun getCacheManager ()Ljavax/cache/CacheManager; | ||
| public fun getConfiguration (Ljava/lang/Class;)Ljavax/cache/configuration/Configuration; | ||
| public fun getName ()Ljava/lang/String; | ||
| public fun invoke (Ljava/lang/Object;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/lang/Object; | ||
| public fun invokeAll (Ljava/util/Set;Ljavax/cache/processor/EntryProcessor;[Ljava/lang/Object;)Ljava/util/Map; | ||
| public fun isClosed ()Z | ||
| public fun iterator ()Ljava/util/Iterator; | ||
| public fun loadAll (Ljava/util/Set;ZLjavax/cache/integration/CompletionListener;)V | ||
| public fun put (Ljava/lang/Object;Ljava/lang/Object;)V | ||
| public fun putAll (Ljava/util/Map;)V | ||
| public fun putIfAbsent (Ljava/lang/Object;Ljava/lang/Object;)Z | ||
| public fun registerCacheEntryListener (Ljavax/cache/configuration/CacheEntryListenerConfiguration;)V | ||
| public fun remove (Ljava/lang/Object;)Z | ||
| public fun remove (Ljava/lang/Object;Ljava/lang/Object;)Z | ||
| public fun removeAll ()V | ||
| public fun removeAll (Ljava/util/Set;)V | ||
| public fun replace (Ljava/lang/Object;Ljava/lang/Object;)Z | ||
| public fun replace (Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Z | ||
| public fun unwrap (Ljava/lang/Class;)Ljava/lang/Object; | ||
| } | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,90 @@ | ||
| import net.ltgt.gradle.errorprone.errorprone | ||
| import org.jetbrains.kotlin.gradle.tasks.KotlinCompile | ||
|
|
||
| plugins { | ||
| `java-library` | ||
| id("io.sentry.javadoc") | ||
| alias(libs.plugins.kotlin.jvm) | ||
| jacoco | ||
| alias(libs.plugins.errorprone) | ||
| alias(libs.plugins.gradle.versions) | ||
| alias(libs.plugins.buildconfig) | ||
| } | ||
|
|
||
| tasks.withType<KotlinCompile>().configureEach { | ||
| compilerOptions.jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 | ||
| compilerOptions.languageVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 | ||
| compilerOptions.apiVersion = org.jetbrains.kotlin.gradle.dsl.KotlinVersion.KOTLIN_1_9 | ||
| } | ||
|
|
||
| dependencies { | ||
| api(projects.sentry) | ||
| compileOnly(libs.jcache) | ||
|
|
||
| compileOnly(libs.jetbrains.annotations) | ||
| compileOnly(libs.nopen.annotations) | ||
| errorprone(libs.errorprone.core) | ||
| errorprone(libs.nopen.checker) | ||
| errorprone(libs.nullaway) | ||
|
|
||
| // tests | ||
| testImplementation(projects.sentry) | ||
| testImplementation(projects.sentryTestSupport) | ||
| testImplementation(libs.jcache) | ||
| testImplementation(kotlin(Config.kotlinStdLib)) | ||
| testImplementation(libs.kotlin.test.junit) | ||
| testImplementation(libs.mockito.kotlin) | ||
| testImplementation(libs.mockito.inline) | ||
| } | ||
|
|
||
| configure<SourceSetContainer> { test { java.srcDir("src/test/java") } } | ||
|
|
||
| jacoco { toolVersion = libs.versions.jacoco.get() } | ||
|
|
||
| tasks.jacocoTestReport { | ||
| reports { | ||
| xml.required.set(true) | ||
| html.required.set(false) | ||
| } | ||
| } | ||
|
|
||
| tasks { | ||
| jacocoTestCoverageVerification { | ||
| violationRules { rule { limit { minimum = Config.QualityPlugins.Jacoco.minimumCoverage } } } | ||
| } | ||
| check { | ||
| dependsOn(jacocoTestCoverageVerification) | ||
| dependsOn(jacocoTestReport) | ||
| } | ||
| } | ||
|
|
||
| tasks.withType<JavaCompile>().configureEach { | ||
| options.errorprone { | ||
| check("NullAway", net.ltgt.gradle.errorprone.CheckSeverity.ERROR) | ||
| option("NullAway:AnnotatedPackages", "io.sentry") | ||
| } | ||
| } | ||
|
|
||
| buildConfig { | ||
| useJavaOutput() | ||
| packageName("io.sentry.jcache") | ||
| buildConfigField( | ||
| "String", | ||
| "SENTRY_JCACHE_SDK_NAME", | ||
| "\"${Config.Sentry.SENTRY_JCACHE_SDK_NAME}\"", | ||
| ) | ||
| buildConfigField("String", "VERSION_NAME", "\"${project.version}\"") | ||
| } | ||
|
|
||
| tasks.jar { | ||
| manifest { | ||
| attributes( | ||
| "Sentry-Version-Name" to project.version, | ||
| "Sentry-SDK-Name" to Config.Sentry.SENTRY_JCACHE_SDK_NAME, | ||
| "Sentry-SDK-Package-Name" to "maven:io.sentry:sentry-jcache", | ||
| "Implementation-Vendor" to "Sentry", | ||
| "Implementation-Title" to project.name, | ||
| "Implementation-Version" to project.version, | ||
| ) | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.