feat(server-utils)!: Start Redis spans as cache spans - #23933
Open
s1gr1d wants to merge 5 commits into
Open
Conversation
s1gr1d
requested review from
JPeer264,
Lms24 and
isaacs
and removed request for
a team
September 2, 2026 12:02
Contributor
size-limit report 📦
|
Lms24
approved these changes
Sep 2, 2026
Lms24
left a comment
Member
There was a problem hiding this comment.
thanks for tackling this so quickly!
| await createTestRunner() | ||
| .withEnv({ STREAMED: 'true', IGNORE_CACHE_GET: 'true' }) | ||
| .unordered() | ||
| .expect({ |
Member
There was a problem hiding this comment.
l: we could also assert on a client report here for the ignored span(s) to make it more explicit, wdyt?
| */ | ||
| export function applyCacheResponseAttributes(span: Span, response: unknown): void { | ||
| const op = spanToJSON(span).attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP]; | ||
| if (op !== CACHE_GET && op !== CACHE_PUT) { |
Member
There was a problem hiding this comment.
q: Do we need to worry about CACHE_REMOVE spans here? or are they not emitted for redis?
Member
Author
There was a problem hiding this comment.
It's mentioned in the JSDoc above why we we return early for deletions. For delete, we cannot set item-size or cache-hit. Both do not make sense.
Member
There was a problem hiding this comment.
my bad for not reading it, sorry! and thanks!
Composes the start-time cache classification with develop's low-cardinality redis db span names (#23741): at each span start site the cache name/op wins for cache-prefixed keys, the streamed db name applies otherwise. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
s1gr1d
enabled auto-merge (squash)
September 2, 2026 15:18
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.
With span streaming,
ignoreSpansruns at span start. Redis cache spans used to start asdb.queryand get renamed tocache.*at response time, so a filter matching what you see in the UI never matched anything (part of #23830).Now a command whose key matches
cachePrefixesstarts as acache.*span on all four instrumentation paths. At response time we only addcache.hit/cache.item_size(as we only know it at this time). Static-lifecycle output is unchanged.Behavior changes and limitations:
cache.*spans. They previously stayeddb.query.maxCacheKeyLengthonly applies totraceLifecycle: 'static'(added to JSDoc). Streamed span names don't need truncation.db.query: the library sanitizes keys to?before we see them (pre-existing).Closes #23832