Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions currencies.json
Original file line number Diff line number Diff line change
Expand Up @@ -972,10 +972,11 @@
"core": false,
"versions": [
{
"v": "5.12.1"
"v": "6.0.0",
"node": ">=20"
},
{
"v": "5.8.3"
"v": "5.12.1"
},
{
"v": "4.7.1"
Expand Down Expand Up @@ -1334,4 +1335,4 @@
}
]
}
]
]
10 changes: 7 additions & 3 deletions packages/core/src/tracing/instrumentation/databases/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,13 @@
}

function instrument(redis) {
// NOTE: v4 no longer exposes the RedisClient. We need to wait till `createClient` get's called
// to get the instance of the redis client
if (!redis.RedisClient) {
// NOTE: Redis versions differ in export shape:
// v4/v5: are strictly factory-based (createClient/createCluster) and do not expose RedisClient.
// v6: expose RedisClient again, but this does NOT imply legacy/class-based behavior.
// RedisClient presence alone cannot be used to distinguish v3 from newer versions.
const isLegacyClassAPI = redis.RedisClient?.prototype && typeof redis.createClient !== 'function';

if (!isLegacyClassAPI) {

Check warning on line 57 in packages/core/src/tracing/instrumentation/databases/redis.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Unexpected negated condition.

See more on https://sonarcloud.io/project/issues?id=instana_nodejs&issues=AZ6L8EkEQ2--oDhGjX2T&open=AZ6L8EkEQ2--oDhGjX2T&pullRequest=2578
// redis automatically loads @redis/client, which can trigger a second instrumentation call.
// We track the instrumentation status via `isRedisClientInstrumented and skip second time.
if (isRedisClientInstrumented) {
Expand Down