[Java] Lettuce 6.x extension issues

Hello,

We are having trouble getting the Lettuce 6.x extension to work with Lettuce 6.1.5 (or 6.0.8)

Classes are not instrumented properly and database queries do not show up.

Here is a log of the Lettuce 5.x extension with Lettuce 5.3.7 working properly:

2021-10-13T18:33:34,956+0000 [1 1] com.newrelic.agent.extension.ExtensionService FINE: Loading extension jar "/usr/local/newrelic/extensions/lettuce-5.0.jar"
2021-10-13T18:33:35,975+0000 [1 1] com.newrelic FINE: registered weave package: com.newrelic.instrumentation.lettuce-5.0
2021-10-13T18:33:52,649+0000 [1 12] com.newrelic.jar_collector FINE: file:/app/libs/lettuce-core-5.3.7.RELEASE.jar Adding the file lettuce-core-5.3.7.RELEASE.jar with version 5.3.7.RELEASE.
2021-10-13T18:34:11,070+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.lettuce-5.0 - validated classloader jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b
2021-10-13T18:34:11,072+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.lettuce-5.0: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b-io/lettuce/core/StatefulRedisConnectionImpl
2021-10-13T18:34:11,072+0000 [1 1] com.newrelic FINE:   io/lettuce/core/StatefulRedisConnectionImpl.<init>:(Lio/lettuce/core/RedisChannelWriter;Lio/lettuce/core/codec/RedisCodec;Ljava/time/Duration;)V
2021-10-13T18:34:11,078+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.lettuce-5.0: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b-io/lettuce/core/pubsub/StatefulRedisPubSubConnectionImpl
2021-10-13T18:34:11,178+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.netty-4.0.8: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b-io/lettuce/core/protocol/CommandHandler
2021-10-13T18:34:11,178+0000 [1 1] com.newrelic FINE:   io/netty/channel/ChannelInboundHandler.<init>:(Lio/lettuce/core/ClientOptions;Lio/lettuce/core/resource/ClientResources;Lio/lettuce/core/protocol/Endpoint;)V
2021-10-13T18:34:11,181+0000 [1 1] com.newrelic DEBUG: Instrumenting class io/lettuce/core/protocol/CommandHandler
2021-10-13T18:34:35,471+0000 [1 63] com.newrelic FINE: com.newrelic.instrumentation.lettuce-5.0: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b-io/lettuce/core/masterslave/StatefulRedisMasterSlaveConnectionImpl
2021-10-13T18:35:23,244+0000 [1 60] com.newrelic FINE: com.newrelic.instrumentation.lettuce-5.0: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@3da2997b-io/lettuce/core/LettuceFutures
2021-10-13T18:35:23,245+0000 [1 60] com.newrelic FINE:  io/lettuce/core/LettuceFutures.awaitOrCancel:(Lio/lettuce/core/RedisFuture;JLjava/util/concurrent/TimeUnit;)Ljava/lang/Object;
2021-10-13T18:35:23,245+0000 [1 60] com.newrelic DEBUG: Instrumenting class io/lettuce/core/LettuceFutures

And the log of extension 6.x, which does not instrument LettuceFutures or StatefulRedisConnectionImpl

021-10-13T18:52:16,051+0000 [1 1] com.newrelic.agent.extension.ExtensionService FINE: Loading extension jar "/usr/local/newrelic/extensions/Lettuce-6.0.jar"
2021-10-13T18:52:17,154+0000 [1 1] com.newrelic FINE: registered weave package: com.newrelic.instrumentation.Lettuce-6.0
2021-10-13T18:52:33,655+0000 [1 12] com.newrelic.jar_collector FINE: file:/app/libs/lettuce-core-6.1.5.RELEASE.jar Adding the file lettuce-core-6.1.5.RELEASE.jar with version 6.1.5.RELEASE.
2021-10-13T18:52:52,078+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.netty-4.0.8: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@25901f38-io/lettuce/core/protocol/CommandHandler
2021-10-13T18:52:52,078+0000 [1 1] com.newrelic FINE:   io/netty/channel/ChannelInboundHandler.<init>:(Lio/lettuce/core/ClientOptions;Lio/lettuce/core/resource/ClientResources;Lio/lettuce/core/protocol/Endpoint;)V
2021-10-13T18:52:52,081+0000 [1 1] com.newrelic DEBUG: Instrumenting class io/lettuce/core/protocol/CommandHandler
2021-10-13T18:52:52,155+0000 [1 1] com.newrelic FINE: com.newrelic.instrumentation.netty-4.0.8: weaved target jdk.internal.loader.ClassLoaders$AppClassLoader@25901f38-io/lettuce/core/pubsub/PubSubCommandHandler
2021-10-13T18:52:52,155+0000 [1 1] com.newrelic FINE:   io/netty/channel/ChannelInboundHandler.<init>:(Lio/lettuce/core/ClientOptions;Lio/lettuce/core/resource/ClientResources;Lio/lettuce/core/codec/RedisCodec;Lio/lettuce/core/pubsub/PubSubEndpoint;)V

Has anyone got the 6.x Lettuce extension working?

Hi @normand.poirier,

Thank you for reaching out to the Explorers Hub!

At this time, support for Lettuce instrumentation is out of our scope since it is an openly sourced project. However, since you have posted this in our community, it is possible that another member may have come across a similar issue and found a workaround they can share.

Please let me know if I can assist with anything else.

Hi @tpaul1,

I’m confused why Lettuce instrumentation would be out of scope due to it being an opensource project, as there are plenty of opensource projects and libraries that are supported by Newrelic. For example, Jedis is an opensource project for communicating with Redis databases in JVM-based languages, and Newrelic seems to consider Jedis within scope and support it just fine.

Thanks

Hi @kevin.viglucci ,

Welcome to the Explorers Hub!

Thank you for providing that feedback. To receive support for the Lettuce instrumentation, it is recommended that you raise any issues to the GitHub repository directly. Due to this being an openly sourced project, where it is contributed to by many, support is scoped to where the contributors have visibility and can provide feedback.

You also have the option to raise your questions here in the Explorers Hub where fellow members or Relics are able to provide any insight as well.

Please let me know if I can assist with anything else.

For anyone encountering the same issue, our New Relic Lettuce 6.x instrumentation now works.

The binary distribution on Github for the extension does not match the source code in the repo.

Building the extension from source fixes the issue.

2 Likes

Hi @normand.poirier

I have built extension from source but still database queries do not show up on newrelic

Lettuce version 6.1.5.

Any thoughts on this?

@normand.poirier happy to hear that this seems to be working for you, but we also tried building from source and weren’t able to get this working.

Also, its nice of NR to mark the question as solved though without the OP (me) confirming…