All Projects → opentracing-contrib → java-redis-client

opentracing-contrib / java-redis-client

Licence: Apache-2.0 license
OpenTracing Instrumentation for Redis Client

Programming Languages

java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to java-redis-client

Ibase4j
Spring,SpringBoot 2.0,SpringMVC,Mybatis,mybatis-plus,motan/dubbo分布式,Redis缓存,Shiro权限管理,Spring-Session单点登录,Quartz分布式集群调度,Restful服务,QQ/微信登录,App token登录,微信/支付宝支付;日期转换、数据类型转换、序列化、汉字转拼音、身份证号码验证、数字转人民币、发送短信、发送邮件、加密解密、图片处理、excel导入导出、FTP/SFTP/fastDFS上传下载、二维码、XML读写、高精度计算、系统配置工具类等等。
Stars: ✭ 1,548 (+4893.55%)
Mutual labels:  redisson, spring-data-redis
redis-modules-java
Java client libraries for redis-modules https://redis.io/modules, based on Redisson. https://github.com/redisson/redisson
Stars: ✭ 57 (+83.87%)
Mutual labels:  redis-client, redisson
salad
Asynchronous Scala Redis Client supporting Sentinel and Redis Cluster
Stars: ✭ 14 (-54.84%)
Mutual labels:  redis-client, lettuce
vscode-redis
Redis Client in VSCode!
Stars: ✭ 63 (+103.23%)
Mutual labels:  redis-client
practice
Java并发编程与高并发解决方案:http://coding.imooc.com/class/195.html Java开发企业级权限管理系统:http://coding.imooc.com/class/149.html
Stars: ✭ 39 (+25.81%)
Mutual labels:  redisson
java-jaxrs
OpenTracing Java JAX-RS instrumentation
Stars: ✭ 37 (+19.35%)
Mutual labels:  opentracing
CloudStructures
Redis Client based on StackExchange.Redis.
Stars: ✭ 124 (+300%)
Mutual labels:  redis-client
lightstep-tracer-ruby
The Lightstep distributed tracing library for Ruby
Stars: ✭ 14 (-54.84%)
Mutual labels:  opentracing
node-redis-connection-pool
A node.js connection manager for Redis
Stars: ✭ 52 (+67.74%)
Mutual labels:  redis-client
redis
efficient client ⚡️
Stars: ✭ 70 (+125.81%)
Mutual labels:  redis-client
braid-go
简单易用的微服务框架 | Ease used microservice framework
Stars: ✭ 34 (+9.68%)
Mutual labels:  opentracing
redis-cpp
redis-cpp is a header-only library in C++17 for Redis (and C++11 backport)
Stars: ✭ 73 (+135.48%)
Mutual labels:  redis-client
SmartRedis
SmartSim Infrastructure Library Clients.
Stars: ✭ 37 (+19.35%)
Mutual labels:  redis-client
opentracing-metrics-tracer
Exports cross-process metrics via OpenTracing to Prometheus.
Stars: ✭ 13 (-58.06%)
Mutual labels:  opentracing
sqlike
Golang Sequel ORM that supports Enum, JSON, Spatial, and many more
Stars: ✭ 18 (-41.94%)
Mutual labels:  opentracing
redimo.go
Use the power of DynamoDB with the ease of the Redis API
Stars: ✭ 29 (-6.45%)
Mutual labels:  redis-client
Payload
Fail-safe asynchronous profile & object caching via Redis & MongoDB in Java for Spigot
Stars: ✭ 23 (-25.81%)
Mutual labels:  jedis
cache redis node
Exemplo de utilização de Cache, com Redis, Mongo, nodejs
Stars: ✭ 30 (-3.23%)
Mutual labels:  redis-client
JRediSearch
Java Client for RediSearch
Stars: ✭ 133 (+329.03%)
Mutual labels:  redis-client
jaeger-node
Out of the box distributed tracing for Node.js applications.
Stars: ✭ 66 (+112.9%)
Mutual labels:  opentracing

Build Status Coverage Status Released Version Apache-2.0 license

OpenTracing Redis Client Instrumentation

OpenTracing instrumentation for Redis Client

Requirements

  • Java 8

Installation

Jedis

Jedis 2

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-jedis</artifactId>
    <version>VERSION</version>
</dependency>

Jedis 3

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-jedis3</artifactId>
    <version>VERSION</version>
</dependency>

Lettuce

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-lettuce-5.2</artifactId>
    <version>VERSION</version>
</dependency>

Redisson

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-redisson</artifactId>
    <version>VERSION</version>
</dependency>

Spring Data Redis 1.x

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-spring-data</artifactId>
    <version>VERSION</version>
</dependency>

Spring Data Redis 2.x

pom.xml

<dependency>
    <groupId>io.opentracing.contrib</groupId>
    <artifactId>opentracing-redis-spring-data2</artifactId>
    <version>VERSION</version>
</dependency>

Usage

// Instantiate tracer
Tracer tracer = ...

// Create TracingConfiguration
TracingConfiguration tracingConfiguration = new TracingConfiguration.Builder(tracer).build(); 

Jedis

// Create Tracing Jedis
Jedis jedis = new TracingJedis(tracingConfiguration);

jedis.set("foo", "bar");
String value = jedis.get("foo");

Jedis Cluster

Set<HostAndPort> jedisClusterNodes = new HashSet<HostAndPort>();
jedisClusterNodes.add(new HostAndPort("127.0.0.1", 7379));

// Create Tracing Jedis Cluster
JedisCluster jc = new TracingJedisCluster(jedisClusterNodes, tracingConfiguration);
jc.set("foo", "bar");
String value = jc.get("foo");

Jedis Pool

// Configure the pool
JedisPoolConfig poolConfig = new JedisPoolConfig();
poolConfig.setMaxIdle(10);
poolConfig.setTestOnBorrow(false);

// Create Tracing Jedis Pool
JedisPool pool = new TracingJedisPool(poolConfig, "127.0.0.1", 6379, tracingConfiguration);

try (Jedis jedis = pool.getResource()) {
    // jedis will be automatically closed and returned to the pool at the end of "try" block
    jedis.set("foo", "bar");
    String value = jedis.get("foo");
}

Jedis Sentinel Pool

// Create Tracing Jedis Sentinel Pool
JedisSentinelPool pool = new TracingJedisSentinelPool(tracingConfiguration, MASTER_NAME, sentinels, poolConfig);

try (Jedis jedis = pool.getResource()) {
// jedis will be automatically closed and returned to the pool at the end of "try" block
   jedis.set("foo", "bar"));
   String value = jedis.get("foo"));
}

Jedis Span Name

By default, span names are set to the operation performed by the Jedis object. To customize the span name, provide a Function to the TracingConfiguration object that alters the span name. If a function is not provided, the span name will remain the default. Refer to the RedisSpanNameProvider class for a function that prefixes the operation name.

TracingConfiguration tracingConfiguration = new TracingConfiguration.Builder(tracer)
    .withSpanNameProvider(RedisSpanNameProvider.PREFIX_OPERATION_NAME("redis."))
    .build(); 
//Create Tracing Jedis with custom span name
Jedis jedis = new TracingJedis(tracingConfiguration);
jedis.set("foo", "bar");
//Span name is now set to "redis.set"

Lettuce

// Create client
RedisClient client = RedisClient.create("redis://localhost");

// Decorate StatefulRedisConnection with TracingStatefulRedisConnection
StatefulRedisConnection<String, String> connection = 
    new TracingStatefulRedisConnection(client.connect(), tracingConfiguration);

// Get sync redis commands
RedisCommands<String, String> commands = connection.sync();

// Get async redis commands
RedisAsyncCommands<String, String> commandsAsync = connection.async();

Redisson

// Create Redisson config object
Config = ...

// Create Redisson instance
RedissonClient redissonClient = Redisson.create(config);

// Decorate RedissonClient with TracingRedissonClient
RedissonClient tracingRedissonClient =  new TracingRedissonClient(redissonClient, tracingConfiguration);

// Get object you need using TracingRedissonClient
RMap<MyKey, MyValue> map = tracingRedissonClient.getMap("myMap");

Spring

// Create tracing connection factory bean
@Bean
public RedisConnectionFactory redisConnectionFactory() {
    LettuceConnectionFactory lettuceConnectionFactory = new LettuceConnectionFactory();
    lettuceConnectionFactory.afterPropertiesSet();
    return new TracingRedisConnectionFactory(lettuceConnectionFactory,
        new TracingConfiguration.Builder(tracer()).build());
}

Note: if you use Lettuce/Jedis you could achieve the same result using the Lettuce/Jedis support when configuring LettuceConnectionFactory/JedisConnectionFactory instead of using a wrapping TracingRedisConnectionFactory.

License

Apache 2.0 License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].