forked from woggioni/rbcs
Add OpenTelemetry tracing support for Redis commands
- Add RedisSpan interface in rbcs-api for opaque span handles - Extend TelemetryController with startRedisSpan/endRedisSpan methods - Implement Redis tracing in rbcs-server-otel via OtelController and RedisOtelSpan - Instrument RedisCacheHandler to create spans around GET and SET commands - Add uses directive in rbcs-server-redis module-info for ServiceLoader discovery Redis spans are created as CLIENT spans with attributes: db.system=redis, db.operation=GET|SET, server.address, server.port
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
package net.woggioni.rbcs.api;
|
||||
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
public interface RedisSpan {
|
||||
|
||||
void setAttribute(@NotNull String key, @NotNull String value);
|
||||
|
||||
void setAttribute(@NotNull String key, long value);
|
||||
}
|
||||
@@ -2,8 +2,15 @@ package net.woggioni.rbcs.api;
|
||||
|
||||
import io.netty.channel.ChannelHandler;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public interface TelemetryController {
|
||||
void initialize();
|
||||
@NotNull ChannelHandler createHandler();
|
||||
|
||||
@Nullable RedisSpan startRedisSpan(@NotNull String command, @NotNull String key);
|
||||
|
||||
void endRedisSpan(@Nullable RedisSpan span);
|
||||
|
||||
void endRedisSpan(@Nullable RedisSpan span, @NotNull Throwable error);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user