Redis queries are not registered in spans (db.statement) #11573
-
We're using Spring Boot 3.2.3 with spring-lettucemod to issue RediSearch (full-text) queries. We also use javaagent for exporting logs, metrics & traces to the OpenTelemetry backend. For dev/local purposes we're using grafana/otel-lgtm image. Reproducible example with step-by-step instructions is here. The problem occurs when I want to see spans and want to isolate exact Redis query (db statement) that is issued. All I can see in Tempo is I can see that spring-lettucemod transitively includes lettuce:lettuce-core redis driver:
According to this docs, Lettuce is supported for database client spans. So, if I'm correct, these Redis queries should be visible in Tempo. I've also found these two system properties for java agent. So my full command for starting the Spring Boot app looks like this:
When I open Grafana, this is what I see: On this list, I can see that some attributes are correctly set, such as I'm not sure why So, in short, how to enable Redis queries (with parameter values) in Tempo using javaagent and otel? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
By default redis queries are sanitized, this can be disabled with
Db client semantic conventions are currently undergoing an effort to declare them stable. This stabilization process will result in many changes to the existing conventions. To smoothen the transition to the new conventions the decision was not to implement the new conventions as the changes are made in the spec, but rather implement all changes together and have a flag that allows users to opt in for the new conventions or remain using the old ones. |
Beta Was this translation helpful? Give feedback.
-
Thanks again for the correction on
So the keywords |
Beta Was this translation helpful? Give feedback.
By default redis queries are sanitized, this can be disabled with
-Dotel.instrumentation.common.db-statement-sanitizer.enabled=false
. This is done so because queries could potentially contains sensitive components like PII, medical info etc. Sending such info to your observability backend could get you in trouble. Have a look at https://github.com/open-telemetry/opentelemetry-jav…