-
-
Notifications
You must be signed in to change notification settings - Fork 443
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
Spring Boot cache integration POC #3457
base: main
Are you sure you want to change the base?
Conversation
Instructions and example for changelogPlease add an entry to Example: ## Unreleased
- Spring Boot cache integration POC ([#3457](https://github.com/getsentry/sentry-java/pull/3457)) If none of the above apply, you can opt out of this check by adding |
Performance metrics 🚀
|
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d6d2b2e | 392.55 ms | 467.50 ms | 74.95 ms |
c7e2fbc | 393.98 ms | 478.24 ms | 84.27 ms |
4e260b3 | 388.40 ms | 468.98 ms | 80.58 ms |
28c9a83 | 366.20 ms | 433.88 ms | 67.67 ms |
baaf637 | 418.39 ms | 496.86 ms | 78.47 ms |
283d83e | 416.81 ms | 497.22 ms | 80.41 ms |
283d83e | 348.44 ms | 392.06 ms | 43.62 ms |
0bf143e | 368.35 ms | 437.47 ms | 69.12 ms |
86f0096 | 368.63 ms | 446.92 ms | 78.29 ms |
619c9b9 | 428.23 ms | 514.66 ms | 86.43 ms |
App size
Revision | Plain | With Sentry | Diff |
---|---|---|---|
d6d2b2e | 1.72 MiB | 2.27 MiB | 555.05 KiB |
c7e2fbc | 1.72 MiB | 2.29 MiB | 576.40 KiB |
4e260b3 | 1.72 MiB | 2.27 MiB | 554.95 KiB |
28c9a83 | 1.70 MiB | 2.28 MiB | 592.00 KiB |
baaf637 | 1.72 MiB | 2.27 MiB | 558.42 KiB |
283d83e | 1.72 MiB | 2.29 MiB | 577.69 KiB |
283d83e | 1.72 MiB | 2.29 MiB | 577.69 KiB |
0bf143e | 1.72 MiB | 2.29 MiB | 576.50 KiB |
86f0096 | 1.72 MiB | 2.29 MiB | 576.50 KiB |
619c9b9 | 1.70 MiB | 2.28 MiB | 592.12 KiB |
} | ||
|
||
@Cacheable(value = "people", key = "{ #root.methodName, #person.firstName, #person.lastName }") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no key config is defined, @Cacheable
will use the object itself as key, so beware of sending PII to Sentry.
import java.util.concurrent.Callable; | ||
import org.springframework.cache.Cache; | ||
|
||
public class SentryCacheWrapper implements Cache { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've just implemented some methods here to showcase how this works. The rest still needs to be implemented.
Collections.singletonMap(SENTRY_SLUG_KEY, "monitor_slug_simple_trigger")); | ||
return trigger; | ||
public CacheManager cacheManager() { | ||
return new SentryCacheManagerWrapper(new ConcurrentMapCacheManager("people")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could also do this in a bean post processor to support the default bean. We'll consider the bean post processor approach but might end up integrating this into our POTel offering.
📜 Description
💡 Motivation and Context
💚 How did you test it?
📝 Checklist
sendDefaultPII
is enabled.🔮 Next steps