ref(spring): [Cache Tracing 15] Use method-specific span operations for cache spans#5204
Draft
adinauer wants to merge 3 commits intofix/cache-tracing-typed-get-hit-detectionfrom
Draft
Conversation
Instead of the 4 generic categories (cache.get, cache.put, cache.remove, cache.flush), use the actual method name as the span operation (e.g. cache.evict, cache.putIfAbsent, cache.retrieve). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Contributor
Semver Impact of This PR🟢 Patch (bug fixes) 📋 Changelog PreviewThis is how your changes will appear in the changelog. This PR will not appear in the changelog. 🤖 This preview updates automatically when you update the PR. |
This was referenced Mar 18, 2026
Draft
Sentry Build Distribution
|
Remove redundant first parameter since it was always "cache." + operationName. The prefix is now applied inside the helper method. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
8 tasks
Member
Author
|
@sentry review |
Member
Author
|
cursor review |
384cb3e to
0a32614
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
PR Stack (Cache Tracing)
📜 Description
Instead of the 4 generic categories (
cache.get,cache.put,cache.remove,cache.flush), use the actual method name as the span operation.Applied to all Spring wrappers (spring, spring-jakarta, spring-7) and JCache wrapper. The base operations (
get,put,remove) remain unchanged since the method name already matches.Full list of renames:
retrieve()cache.getcache.retrieveputIfAbsent()cache.putcache.putIfAbsentreplace()cache.putcache.replacegetAndPut()cache.putcache.getAndPutgetAndReplace()cache.putcache.getAndReplaceputAll()cache.putcache.putAllevict()cache.removecache.evictevictIfPresent()cache.removecache.evictIfPresentgetAndRemove()cache.removecache.getAndRemoveremoveAll(keys)cache.removecache.removeAllclear()cache.flushcache.clearinvalidate()cache.flushcache.invalidateremoveAll()cache.flushcache.removeAllinvoke()cache.getcache.invokeinvokeAll()cache.getcache.invokeAllgetAll()cache.getcache.getAllAlso removed the redundant first parameter from
startSpan/startSpanForKeyshelpers since it was always"cache." + operationName— the prefix is now derived inside the method.💡 Motivation and Context
More granular span operations provide better visibility into which specific cache method was called, rather than grouping all operations into 4 broad categories.
💚 How did you test it?
📝 Checklist
sendDefaultPIIis enabled.🔮 Next steps
#skip-changelog