Skip to content

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

Draft
adinauer wants to merge 1 commit intofeat/cache-tracing-wrappersfrom
feat/cache-tracing-option
Draft

feat(core): [Cache Tracing 2] Add enableCacheTracing option#5141
adinauer wants to merge 1 commit intofeat/cache-tracing-wrappersfrom
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
  • (otel) Create sentry-opentelemetry-otlp module for combining OpenTelemetry SDK OTLP export with Sentry SDK by adinauer in #5100
  • (screenshot) Add screenshot masking using view hierarchy by romtsn in #5077
  • (spring) [Cache Tracing 1] Add SentryCacheWrapper and SentryCacheManagerWrapper by adinauer in #5137

Bug Fixes 🐛

  • Safe unregister SystemEventsBroadcastReceiver by kollesnica1337 in #5106

Internal Changes 🔧

Deps

  • Bump getsentry/craft from 2.21.7 to 2.23.1 by dependabot in #5129
  • Update Native SDK to v0.13.1 by github-actions in #5104
  • Bump actions/upload-artifact from 6 to 7 by dependabot in #5130
  • Bump actions/download-artifact from 7 to 8 by dependabot in #5132
  • Bump gradle/actions from 5.0.1 to 5.0.2 by dependabot in #5131
  • Bump github/codeql-action from 4.32.2 to 4.32.4 by dependabot in #5109
  • Bump getsentry/craft from 2.21.2 to 2.21.7 by dependabot in #5110

🤖 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 5f39eb5

@adinauer
Copy link
Member Author

adinauer commented Mar 3, 2026

PR Stack (Cache Tracing)

  • #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 314.37 ms 361.40 ms 47.03 ms
Size 1.58 MiB 2.29 MiB 723.27 KiB

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

Startup times

Revision Plain With Sentry Diff
2876c40 339.24 ms 405.65 ms 66.41 ms

App size

Revision Plain With Sentry Diff
2876c40 1.58 MiB 2.29 MiB 723.29 KiB

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