Skip to content

Conversation

@s1gr1d
Copy link
Member

@s1gr1d s1gr1d commented Oct 28, 2025

This removes the automatic truncation of the span description. Now, all cache keys are set in the description.

part of #17389

@s1gr1d s1gr1d added the Integration: redis Issues related to Redis support for the Sentry Node SDK label Oct 28, 2025
Comment on lines 34 to 50
describe('early returns', () => {
it.each([
{ desc: 'no args', cmd: 'get', args: [], response: 'test' },
{ desc: 'unsupported command', cmd: 'exists', args: ['key'], response: 'test' },
{ desc: 'no cache prefixes', cmd: 'get', args: ['key'], response: 'test', options: {} },
{ desc: 'non-matching prefix', cmd: 'get', args: ['key'], response: 'test', options: { cachePrefixes: ['c'] } },
])('should always set sentry.origin but return early when $desc', ({ cmd, args, response, options = {} }) => {
vi.clearAllMocks();
Object.assign(_redisOptions, options);

cacheResponseHook(mockSpan, cmd, args, response);

expect(mockSpan.setAttribute).toHaveBeenCalledWith('sentry.origin', 'auto.db.otel.redis');
expect(mockSpan.setAttributes).not.toHaveBeenCalled();
expect(mockSpan.updateName).not.toHaveBeenCalled();
});
});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some general tests for the handler, as there were none for this behavior so far.

cursor[bot]

This comment was marked as outdated.

@github-actions
Copy link
Contributor

github-actions bot commented Oct 28, 2025

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.
⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 8,877 - 11,060 -20%
GET With Sentry 1,380 16% 1,642 -16%
GET With Sentry (error only) 6,051 68% 7,819 -23%
POST Baseline 1,195 - 1,142 +5%
POST With Sentry 515 43% 529 -3%
POST With Sentry (error only) 1,059 89% 1,028 +3%
MYSQL Baseline 3,265 - 4,015 -19%
MYSQL With Sentry 461 14% 496 -7%
MYSQL With Sentry (error only) 2,700 83% 3,286 -18%

View base workflow run

@s1gr1d s1gr1d requested review from JPeer264 and chargome November 4, 2025 12:40
{ desc: 'no cache prefixes', cmd: 'get', args: ['key'], response: 'test', options: {} },
{ desc: 'non-matching prefix', cmd: 'get', args: ['key'], response: 'test', options: { cachePrefixes: ['c'] } },
])('should always set sentry.origin but return early when $desc', ({ cmd, args, response, options = {} }) => {
vi.clearAllMocks();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

super-l: Maybe it is more future proof to move this into the afterEach

@s1gr1d s1gr1d enabled auto-merge (squash) November 6, 2025 09:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Integration: redis Issues related to Redis support for the Sentry Node SDK

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants