Skip to content

Commit

Permalink
fix(redis): suppress error for unsupported redis@4
Browse files Browse the repository at this point in the history
Full fledged support for redis@4 will follow very soon.
  • Loading branch information
basti1302 committed Sep 20, 2022
1 parent 13ba5f5 commit ffad2c2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions packages/core/src/tracing/instrumentation/database/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ const tracingUtil = require('../../tracingUtil');
const constants = require('../../constants');
const cls = require('../../cls');

let logger;
logger = require('../../../logger').getLogger('tracing/redis', newLogger => {
logger = newLogger;
});

let isActive = false;

exports.spanName = 'redis';
Expand All @@ -31,6 +36,10 @@ exports.init = function init() {
};

function instrument(redis) {
if (!redis.RedisClient) {
logger.debug('Aborting the attempt to instrument redis, this seems to be an unsupported version of redis.');
return;
}
const redisClientProto = redis.RedisClient.prototype;
commands.list.forEach(name => {
// Some commands are not added or are renamed. Ignore them.
Expand Down

0 comments on commit ffad2c2

Please sign in to comment.