How do I get the automatic instrumentation of opentelemetry to work with Redis?

189 views Asked by At

I'm trying to get the Redis traces to appear in Jaeger with my Spring Boot that is instrumented with

JAVA_TOOL_OPTIONS: "-javaagent:/opentelemetry-javaagent.jar"

I'm using Redis with Spring Session in case that matters. But with manual instrumentation using micrometer tracing I was able to get it working.

I've had the following environment variables

OTEL_JAVAAGENT_LOGGING: application
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
OTEL_PROPAGATORS: tracecontext,baggage,b3
OTEL_INSTRUMENTATION_COMMON_DB_STATEMENT_SANITIZER_ENABLED: "false"
OTEL_INSTRUMENTATION_COMMON_DEFAULT_ENABLED: "true"
OTEL_INSTRUMENTATION_LETTUCE_ENABLED: "true"
OTEL_INSTRUMENTATION_COMMON_PEER_SERVICE_MAPPING: "redis=redis"

I also tried explicitly adding this to build.gradle.kts

runtimeOnly("io.opentelemetry.instrumentation:opentelemetry-lettuce-5.1:1.31.0-alpha")

But I can only get up to the HTTP controller.

I can confirm that I am getting sessions being created after flushing the redis db

> docker exec b42c5e6cabee redis-cli keys \*
spring:session:sessions:64d2da7a-fa11-4cd5-a1ec-2622fbdd77c6

enter image description here

0

There are 0 answers