@@ -14,7 +14,7 @@ import {
1414import type { TransactionSource } from '@sentry/types' ;
1515import { getSanitizedUrlString , parseUrl , stripUrlQueryAndFragment } from '@sentry/utils' ;
1616
17- import { SEMANTIC_ATTRIBUTE_CACHE_HIT } from '@sentry/core' ;
17+ import { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core' ;
1818import type { AbstractSpan } from '../types' ;
1919import { getSpanKind } from './getSpanKind' ;
2020import { spanHasAttributes , spanHasName } from './spanTypes' ;
@@ -44,9 +44,14 @@ export function parseSpanDescription(span: AbstractSpan): SpanDescription {
4444 return descriptionForHttpMethod ( { attributes, name, kind : getSpanKind ( span ) } , httpMethod ) ;
4545 }
4646
47- // If db.type exists then this is a database call span (unless it is cache)
4847 const dbSystem = attributes [ SEMATTRS_DB_SYSTEM ] ;
49- if ( dbSystem && typeof attributes [ SEMANTIC_ATTRIBUTE_CACHE_HIT ] !== 'boolean' ) {
48+ const opIsCache =
49+ typeof attributes [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] === 'string' &&
50+ attributes [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] . startsWith ( 'cache.' ) ;
51+
52+ // If db.type exists then this is a database call span
53+ // If the Redis DB is used as a cache, the span description should not be changed
54+ if ( dbSystem && ( ! attributes [ SEMANTIC_ATTRIBUTE_SENTRY_OP ] || ! opIsCache ) ) {
5055 return descriptionForDbSystem ( { attributes, name } ) ;
5156 }
5257
0 commit comments