edit-icon download-icon

Redis tracing

Last Updated: Jan 23, 2018

Function overview

After Redis tracing support is added, whenever applications access and perform operations on Redis, the process is recorded in EagleEye trace logs and EDAS collects, analyzes the statistics of the logs. Then information about Redis calls is displayed on the tracing and call analysis page of the EDAS platform.

Supported scope

Due to the wide range of Redis database variants and the usability of Spring Data, Redis trace support is only available for Spring Data Redis of 1.7.4.RELEASE. If you use any other database (for example, Jedis) than Spring Data Redis, you cannot view relevant information on the EagleEye trace interface (which is accessible from Digital Operations > Trace Details on the left-side menu bar of the EDAS console).

Note: If you use Spring Data Redis later than 1.7.4.RELEASE and the version does not support the provided functions, open a ticket to consult with us.

Usage instructions

For applications on the EDAS platform, Redis trace support replaces Spring Data Redis and is used in the same way as Spring Data Redis. For usage instructions on Spring Data Redis, see the user guide. At the code level, EDAS is compatible with Spring Data Redis 1.7.4-RELEASE. To enable Redis tracing support, follow these steps:

  1. Open the {user.home}/.m2/settings.xml file to configure the local Maven repository.

    1. <profile>
    2. <id>edas.oss.repo</id>
    3. <repositories>
    4. <repository>
    5. <id>edas-oss-central</id>
    6. <name>taobao mirror central</name>
    7. <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
    8. <snapshots>
    9. <enabled>true</enabled>
    10. </snapshots>
    11. <releases>
    12. <enabled>true</enabled>
    13. </releases>
    14. </repository>
    15. </repositories>
    16. <pluginRepositories>
    17. <pluginRepository>
    18. <id>edas-oss-plugin-central</id>
    19. <url>http://edas-public.oss-cn-hangzhou.aliyuncs.com/repository</url>
    20. <snapshots>
    21. <enabled>true</enabled>
    22. </snapshots>
    23. <releases>
    24. <enabled>true</enabled>
    25. </releases>
    26. </pluginRepository>
    27. </pluginRepositories>
    28. </profile>
    29. </profiles>

    Activate the corresponding profile:

    1. <activeProfiles>
    2. <activeProfile>edas.oss.repo</activeProfile>
    3. </activeProfiles>
  2. Add dependency to the pom.xml file in the Maven project.

    1. <dependency>
    2. <groupId>com.alibaba.middleware</groupId>
    3. <artifactId>spring-data-redis</artifactId>
    4. <version>1.7.4.RELEASE</version>
    5. </dependency>

Redis command support

The following tables list the Redis commands supported by Spring Data Redis and the support for EagleEye trace logs.

Key-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Key DEL RedisOperations.delete Y
DUMP RedisOperations.dump Y
EXISTS RedisOperations.hasKey Y
EXPIRE RedisOperations.expire Y
EXPIREAT RedisOperations.expireAt Y
KEYS RedisOperations.keys Y
MIGRATE N
MOVE RedisOperations.move Y
OBJECT N
PERSIST RedisOperations.persist Y
PEXPIRE RedisOperations.expire Y
PEXPIREAT RedisOperations.expireAt Y
PTTL RedisOperations.getExpire Y
RANDOMKEY RedisOperations.randomKey Y
RENAME RedisOperations.rename Y key: oldKey:${oldKey};newKey:${newKey}
RENAMENX RedisOperations.renameIfAbsent Y
RESTORE RedisOperations.restore Y
SORT RedisKeyCommands.sort Y key: query:${SortQuery}
TTL RedisOperations.getExpire Y
TYPE RedisOperations.type Y
SCAN RedisKeyCommands.scan N  

String-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
String APPEND ValueOperations.append Y
BITCOUNT N
BITOP N
BITFIELD N
DECR ValueOperations.increment Y
DECRBY ValueOperations.increment Y
GET ValueOperations.get Y
GETBIT ValueOperations.getBit Y
GETRANGE ValueOperations.get Y
GETSET ValueOperations.getAndSet Y
INCR ValueOperations.increment Y
INCRBY ValueOperations.increment Y
INCRBYFLOAT ValueOperations.increment Y
MGET ValueOperations.multiGet Y
MSET ValueOperations.multiSet Y
MSETNX ValueOperations.multiSetIfAbsent Y
PSETEX ValueOperations.set Y
SET ValueOperations.set Y
SETBIT ValueOperations.setBit Y
SETEX ValueOperations.set Y
SETNX ValueOperations.setIfAbsent Y
SETRANGE ValueOperations.set Y
STRLEN ValueOperations.size Y  

Hash-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Hash HDEL HashOperations.delete Y
HEXISTS HashOperations.hasKey Y
HGET HashOperations.get Y
HGETALL HashOperations.entries Y
HINCRBY HashOperations.increment Y
HINCRBYFLOAT HashOperations.increment Y
HKEYS HashOperations.keys Y
HLEN HashOperations.size Y
HMGET HashOperations.multiGet Y
HMSET HashOperations.putAll Y
HSET HashOperations.put Y
HSETNX HashOperations.putIfAbsent Y
HVALS HashOperations.values Y
HSCAN HashOperations.san Y
HSTRLEN N  

List-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
List BLPOP ListOperations.leftPop Y
BRPOP ListOperations.rightPop Y
BRPOPLPUSH ListOperations.rightPopAndLeftPush Y key: sourceKey:${sourceKey};destKey:${destKey}
LINDEX ListOperations.index Y
LINSERT ListOperations.leftPush Y
LLEN ListOperations.size Y
LPOP ListOperations.leftPop Y
LPUSH ListOperations.leftPush Y
LPUSHX ListOperations.leftPushIfPresent Y
LRANGE ListOperations.range Y
LREM ListOperations.remove Y
LSET ListOperations.set Y
LTRIM ListOperations.trim Y
RPOP ListOperations.rightPop Y
RPOPLPUSH ListOperations.rightPopAndLeftPush Y key: sourceKey:${sourceKey};destKey:${destKey}
RPUSH ListOperations.rightPush Y
RPUSHX ListOperations.rightPushIfPresent Y  

Set-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Set SADD SetOpertions.add Y
SCARD SetOpertions.size Y
SDIFF SetOpertions.difference Y
SDIFFSTORE SetOpertions.differenceAndStore Y
SINTER SetOpertions.intersect Y
SINTERSTORE SetOpertions.intersectAndStore Y
SISMEMBER SetOpertions.isMember Y
SMEMBERS SetOpertions.members Y
SMOVE SetOpertions.move Y
SPOP SetOpertions.pop Y
SRANDMEMBER SetOpertions.randomMember randomMembers distinctRandomMembers Y
SREM SetOpertions.remove Y
SUNION SetOpertions.union Y
SUNIONSTORE SetOpertions.unionAndStore Y
SSCAN SetOpertions.scan Y  

SortedSet-type operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
SortedSet ZADD ZSetOperations.add Y
ZCARD ZSetOperations.size/zCard Y
ZCOUNT ZSetOperations.count Y
ZINCRBY ZSetOperations.incrementScore Y
ZRANGE ZSetOperYations.range rangeWithScores Y
ZRANGEBYSCORE ZSetOperations.rangeByScore rangeByScoreWithScores Y
ZRANK ZSetOperations.rank Y
ZREM ZSetOperations.remove Y
ZREMRANGEBYRANK ZSetOperations.removeRange Y
ZREMRANGEBYSCORE ZSetOperations.removeRangeByScore Y
ZREVRANGE ZSetOperations.reverseRange reverseRangeWithScores Y
ZREVRANGEBYSCORE ZSetOperations.reverseRangeByScore reverseRangeByScoreWithScores Y
ZREVRANK ZSetOperations.reverseRank Y
ZSCORE ZSetOperations.score Y
ZUNIONSTORE ZSetOperations.unionAndStore Y
ZINTERSTORE ZSetOperations.intersectAndStore Y
ZSCAN ZSetOperations.scan Y
ZRANGEBYLEX ZSetOperations.rangeByLex Y
ZLEXCOUNT N
ZREMRANGEBYLEX N  

HyperLogLog operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
HyperLogLog PFADD HyperLogLogOperations.add Y
PFCOUNT HyperLogLogOperations.size Y
PFMERGE HyperLogLogOperations.union Y key: dest:${destination}

Pub/Sub (publish/subscribe) operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Pub/Sub PSUBSCRIBE N
PUBLISH RedisOperations.convertAndSend Y key: msg:${msg}
PUBSUB RedisMessageListenerContainer .setMessageListeners .addMessageListener N
PUNSUBSCRIBE N
UNSUBSCRIBE N  

Transaction operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Transaction DISCARD RedisOperations.discard Y
EXEC RedisOperations.exec Y key: execRaw
MULTI RedisOperations.multi Y
UNWATCH RedisOperations.unwatch Y
WATCH RedisOperations.watch Y  

Script operations

Data structure/Object Operation Spring Data Redis method EDAS support for EagleEye tracing (Y/N) Remarks
Script EVAL ScriptExecutor.execute Y key: Null
EVALSHA ScriptExecutor.execute Y key: Null
SCRIPT EXISTS RedisScriptingCommands.scriptExists N
SCRIPT FLUSH RedisScriptingCommands.scriptFlush N
SCRIPT KILL RedisScriptingCommands.scriptKill N
SCRIPT LOAD RedisScriptingCommands.scriptLoad N  
Thank you! We've received your feedback.