Generalize OTEL API and add memcache tracing support
CI / build (push) Successful in 6m22s

- Rename RedisSpan -> SpanHandle for generic span handling
- Generalize TelemetryController methods: startSpan/endSpan with dbSystem param
- Rename RedisOtelSpan -> OtelSpanHandle in rbcs-server-otel
- Update Redis cache handler to use new generic API
- Add OpenTelemetry tracing for memcache GET and SET commands
- Add channel property to MemcacheRequestController for server address attribution
- Add uses TelemetryController directive in memcache module-info

Memcache spans follow the same pattern as Redis:
db.system=memcache, db.operation=GET|SET, server.address, server.port
This commit is contained in:
opencode
2026-05-21 11:16:48 +00:00
committed by Walter Oggioni
parent f154bbd33c
commit 9a7a2566fa
10 changed files with 170 additions and 82 deletions
@@ -2,9 +2,12 @@ package net.woggioni.rbcs.api;
import org.jetbrains.annotations.NotNull;
public interface RedisSpan {
public interface SpanHandle {
void setAttribute(@NotNull String key, @NotNull String value);
void setAttribute(@NotNull String key, long value);
void setAttribute(@NotNull String key, boolean value);
}
@@ -4,13 +4,15 @@ import io.netty.channel.ChannelHandler;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
import java.util.Map;
public interface TelemetryController {
void initialize();
@NotNull ChannelHandler createHandler();
@Nullable RedisSpan startRedisSpan(@NotNull String command, @NotNull String key);
@Nullable SpanHandle startSpan(@NotNull String command);
void endRedisSpan(@Nullable RedisSpan span);
void endSpan(@Nullable SpanHandle span);
void endRedisSpan(@Nullable RedisSpan span, @NotNull Throwable error);
void endSpan(@Nullable SpanHandle span, @NotNull Throwable error);
}