newrelic / newrelic-java-agent

The New Relic Java agent
Apache License 2.0
202 stars 143 forks source link

H2 Database Metrics are not collected when running JDK 11 #117

Closed RobertTTaylor9517 closed 7 months ago

RobertTTaylor9517 commented 3 years ago

Description

When using the Java Agent with an application running JDK 8, New Relic is able to receive metrics for my H2 database. After upgrading my JDK to Open JDK 11 I can no longer see my H2 database metrics. I was able to confirm that the instrumentation for my H2 database is still being loaded.

Support Ticket #: 431564

Expected Behavior

To be able to receive metrics for our H2 database calls as we did when using JDK 8.

Troubleshooting or NR Diag results

Logs are further details are in the support ticket below.

Steps to Reproduce

There is a sample application in the support ticket.

Additional context

Internal support ticket with details: https://newrelic.zendesk.com/agent/tickets/431564

(Migrate to Jira)

XiXiaPdx commented 3 years ago

I've confirmed the lack of database activity in the test app. The H2 database instrumentation is different between Java 8 and 11. With JDK 11, we are skipping jdbc-generic instrumentation of the H2 database classes.

Java 8

Screen Shot 2020-11-17 at 1 07 52 PM

Java 11

Screen Shot 2020-11-17 at 1 09 27 PM
fbessai commented 3 years ago

Hi @XiXiaPdx , this issue is happening also for MySql. It's not only specific to H2

kford-newrelic commented 2 years ago

@richard-gibson not necessarily specific to our Spring Reactive initiative but let's start under the assumption that we can leverage this for that too... We can switch gears and create a separate/new issue if that makes more sense.

kford-newrelic commented 2 years ago

Not selected for the next quarter's product roadmap. Will consider for a future quarter.

workato-integration[bot] commented 2 years ago

https://issues.newrelic.com/browse/NEWRELIC-4039

kford-newrelic commented 7 months ago

Need to spike on this a bit. Are more supported instrumentation modules affected (or just H2)? More JDK versions (or just 11)?

jtduffy commented 7 months ago

I took an old Spring boot 2 project with H2, and tested with J11, 17 and 21. In all cases, the transactions reported successfully, including the H2 interactions. All relevant JDBC and H2 instrumentation also applied properly.