Skip to content

Commit d0f8f84

Browse files
committed
change if condition
1 parent 7814781 commit d0f8f84

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

packages/opentelemetry/src/utils/parseSpanDescription.ts

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import {
1414
import type { TransactionSource } from '@sentry/types';
1515
import { getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment } from '@sentry/utils';
1616

17-
import { SEMANTIC_ATTRIBUTE_SENTRY_OP } from '@sentry/core';
17+
import { SEMANTIC_ATTRIBUTE_CACHE_HIT } from '@sentry/core';
1818
import type { AbstractSpan } from '../types';
1919
import { getSpanKind } from './getSpanKind';
2020
import { spanHasAttributes, spanHasName } from './spanTypes';
@@ -44,14 +44,9 @@ 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 OP is cache)
47+
// If db.type exists then this is a database call span (unless it is cache)
4848
const dbSystem = attributes[SEMATTRS_DB_SYSTEM];
49-
if (
50-
dbSystem &&
51-
(!attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] ||
52-
(typeof attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP] === 'string' &&
53-
!attributes[SEMANTIC_ATTRIBUTE_SENTRY_OP].startsWith('cache.')))
54-
) {
49+
if (dbSystem && typeof attributes[SEMANTIC_ATTRIBUTE_CACHE_HIT] !== 'boolean') {
5550
return descriptionForDbSystem({ attributes, name });
5651
}
5752

0 commit comments

Comments
 (0)