-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
feat(redis): Add cache logic for redis-4 #12429
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
9bdb19b
feat(redis): Add cache logic for redis-4
s1gr1d 38ef208
review comments
s1gr1d a5a4641
modify import
s1gr1d d02fd3d
fix tests
s1gr1d ce7975c
Merge branch 'develop' into sig/add-redis-4-integration
s1gr1d ef7b5c5
fix uppercase/lowercase
s1gr1d debbebd
fix redis client init
s1gr1d dca7258
delete network items (not included in redis-4)
s1gr1d 13c818f
fix mGet args
s1gr1d 877f111
Merge branch 'develop' into sig/add-redis-4-integration
s1gr1d d1143bc
Merge branch 'develop' into sig/add-redis-4-integration
s1gr1d eb024b4
Merge branch 'develop' into sig/add-redis-4-integration
s1gr1d 69509b7
Merge branch 'develop' into sig/add-redis-4-integration
s1gr1d File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
54 changes: 54 additions & 0 deletions
54
dev-packages/node-integration-tests/suites/tracing/redis-cache/scenario-redis-4.js
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| const { loggingTransport } = require('@sentry-internal/node-integration-tests'); | ||
| const Sentry = require('@sentry/node'); | ||
|
|
||
| Sentry.init({ | ||
| dsn: 'https://[email protected]/1337', | ||
| release: '1.0', | ||
| tracesSampleRate: 1.0, | ||
| transport: loggingTransport, | ||
| integrations: [Sentry.redisIntegration({ cachePrefixes: ['redis-cache:'] })], | ||
| }); | ||
|
|
||
| // Stop the process from exiting before the transaction is sent | ||
| setInterval(() => {}, 1000); | ||
|
|
||
| const { createClient } = require('redis-4'); | ||
|
|
||
| async function initializeClient() { | ||
| return createClient().connect(); | ||
| } | ||
|
|
||
| let redisClient; | ||
|
|
||
| (async function () { | ||
| redisClient = await initializeClient(); | ||
| })(); | ||
|
|
||
| async function run() { | ||
| await Sentry.startSpan( | ||
| { | ||
| name: 'Test Span', | ||
| op: 'test-span', | ||
| }, | ||
| async () => { | ||
| try { | ||
| await redisClient.set('redis-test-key', 'test-value'); | ||
| await redisClient.set('redis-cache:test-key', 'test-value'); | ||
|
|
||
| await redisClient.set('redis-cache:test-key-set-EX', 'test-value', 'EX', 10); | ||
| await redisClient.setex('redis-cache:test-key-setex', 10, 'test-value'); | ||
|
|
||
| await redisClient.get('redis-test-key'); | ||
| await redisClient.get('redis-cache:test-key'); | ||
| await redisClient.get('redis-cache:unavailable-data'); | ||
|
|
||
| await redisClient.mget('redis-test-key', 'redis-cache:test-key', 'redis-cache:unavailable-data'); | ||
| } finally { | ||
| await redisClient.disconnect(); | ||
| } | ||
| }, | ||
| ); | ||
| } | ||
|
|
||
| // eslint-disable-next-line @typescript-eslint/no-floating-promises | ||
| run(); |
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
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this import is not correct, should not have the
/srcpart (this probably comes from the editor...)