Skip to content

feat(core): [Cache Tracing 2] Add enableCacheTracing option#5141

Merged
adinauer merged 2 commits intofeat/cache-tracingfrom
feat/cache-tracing-option
Mar 5, 2026
Merged

feat(core): [Cache Tracing 2] Add enableCacheTracing option#5141
adinauer merged 2 commits intofeat/cache-tracingfrom
feat/cache-tracing-option

Conversation

@adinauer
Copy link
Member

@adinauer adinauer commented Mar 3, 2026

📜 Description

Adds enableCacheTracing boolean option to SentryOptions and ExternalOptions. When disabled (the default), SentryCacheWrapper skips span creation entirely.

💡 Motivation and Context

Part of #4120

Cache tracing should be opt-in so it doesn't affect existing users. This follows the same pattern as enableDatabaseTransactionTracing.

💚 How did you test it?

  • SentryOptionsTest — default value, merge behavior
  • ExternalOptionsTest — property binding for enable-cache-tracing
  • SentryCacheWrapperTest — no span created when option is disabled

📝 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

  • PR 3: Add BeanPostProcessor and Spring Boot 4 auto-configuration

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

github-actions bot commented Mar 3, 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).


New Features ✨

Core

  • [Cache Tracing 2] Add enableCacheTracing option by adinauer in #5141
  • [Cache Tracing 2] Add enableCacheTracing option by adinauer in #5141

Spring

  • [Cache Tracing 3] Add BeanPostProcessor and auto-configuration by adinauer in #5142
  • [Cache Tracing 1] Add SentryCacheWrapper and SentryCacheManagerWrapper by adinauer in #5137

🤖 This preview updates automatically when you update the PR.

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Fails
🚫 Please consider adding a changelog entry for the next release.
Messages
📖 Do not forget to update Sentry-docs with your feature once the pull request gets approved.

Instructions and example for changelog

Please add an entry to CHANGELOG.md to the "Unreleased" section. Make sure the entry includes this PR's number.

Example:

## Unreleased

### Features

- [Cache Tracing 2] Add enableCacheTracing option ([#5141](https://github.com/getsentry/sentry-java/pull/5141))

If none of the above apply, you can opt out of this check by adding #skip-changelog to the PR description or adding a skip-changelog label.

Generated by 🚫 dangerJS against 8ef6ac5

@adinauer
Copy link
Member Author

adinauer commented Mar 3, 2026

PR Stack (Cache Tracing)

  • #5161Collection PR (full diff → main)
  • #5137 — Add SentryCacheWrapper and SentryCacheManagerWrapper
  • #5141 — Add enableCacheTracing option
  • #5142 — Add BeanPostProcessor and auto-configuration

@github-actions
Copy link
Contributor

github-actions bot commented Mar 3, 2026

Performance metrics 🚀

  Plain With Sentry Diff
Startup time 285.09 ms 372.84 ms 87.75 ms
Size 1.58 MiB 2.29 MiB 722.92 KiB

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

Startup times

Revision Plain With Sentry Diff
3e5f591 317.48 ms 356.80 ms 39.32 ms
2876c40 339.24 ms 405.65 ms 66.41 ms

App size

Revision Plain With Sentry Diff
3e5f591 0 B 0 B 0 B
2876c40 1.58 MiB 2.29 MiB 723.29 KiB

Base automatically changed from feat/cache-tracing-wrappers to feat/cache-tracing March 5, 2026 14:07
@adinauer adinauer merged commit 4385665 into feat/cache-tracing Mar 5, 2026
58 of 62 checks passed
@adinauer adinauer deleted the feat/cache-tracing-option branch March 5, 2026 14:07
@adinauer adinauer restored the feat/cache-tracing-option branch March 5, 2026 14:13
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