dd-trace-java
dd-trace-java copied to clipboard
Add `dd.trace.db.client.split-by-instance` support for Redis
We use a couple of Redis clusters and right now and we would like to see requests on a per instance basis. I noticed that currently this feature already exists for splitting DB requests per instance, but it doesn't work for Redis.
I took a quick look at the source code and I think it's because dbInstance returns null:
https://github.com/DataDog/dd-trace-java/blob/6b96665bb129b123c510cb55e0b64ad40148a183/dd-java-agent/instrumentation/jedis-3.0/src/main/java/datadog/trace/instrumentation/jedis30/JedisClientDecorator.java#L48
Maybe instead the hostname of the server can be passed instead?
Another thing we don't have redis hostname attribute logged. so if app is connecting to multiple redis it's just blind assumption.