-
Notifications
You must be signed in to change notification settings - Fork 149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spring Reactive DB Drivers - MongoDB Support #198
Comments
The existing mongo instrumentation seems to be partially applying when mongo reactive is being used. This is causing a number of issues (skewed response times, memory pressure) as those instrumentation modules aren't intended to support mongo reactive. See this internal slack thread for some additional context. To prevent such issues when using mongo reactive the existing instrumentation should be disabled.
As part of the work to officially support mongo reactive we need to determine whether or not the old instrument should apply and be supplemented by an additional instrumentation specific to mongo reactive. Or we need to ensure that the old instrumentation modules don't apply at all and only the new mongo reactive instrumentation does. |
@jasonjkeller the instrumentation artifact IDs use
Any update on reactive driver support? The vast majority of our MongoDB integrations us the reactive driver, and we're pretty blind at the moment. To be honest, it's a pretty big issue :( |
We have a number of applications that use both the sync and async driver. When using a version 3.x MongoDB driver we could see the synchronous queries, while the asynchronous queries did not show up in New Relic. Now that we have upgraded to driver version 4.x we hit the transaction timeout issue discussed above. This forces us to disable instrumentation of the synchronous driver as suggested, thus further reducing our visibility. I see that version 4.0.0 of the MongoDB driver landed in Maven Central on 2020-03-04, i.e. 16 months ago. Given MongoDB's popularity, can you please prioritize support for the 4.x line? As a customer, is there anything we can do to help? |
Upon further testing we concluded that disabling just the MongoDB 3.7 instrumentation is enough:
This way new Relic still reports queries by the synchronous driver, thereby maintaining the status quo. (Apparently the fallback to the 3.1 or 3.0 instrumentation suffices.) @nathankooij filed a PR that is expected to restore this behavior out of the box: #341. |
Current Mongo DB drivers
SpringBoot 2.0.x introduced two different async drivers for mongdb.
SpringBoot 2.0.x
SpringBoot 2.1.x
SpringBoot 2.2.x
SpringBoot 2.3.x saw the removal of SpringBoot 2.3.x
SpringBoot 2.4.x
SpringBoot 2.5.x
|
The problem with the existing mongo sync client instrumentation applying to the mongo reactive client is that an unexpected thread switch happens between the mongo command starting and completing which causes A mongo command is started and the instrumentation's Lines 37 to 43 in 95edf01
When the command completes the Lines 73 to 79 in 95edf01
This means that the |
Add out-of-the-box Java agent support for MongoDB under the Spring Reactive framework
See MMF doc
Add support for Reactive calls for MongoDB so that database interactions are instrumented by the Java Agent.
MongoDB, Redis, and Cassandra all have native reactive support in Spring Data. Many relational databases (Postgres, Microsoft SQL Server, MySQL, H2, and Google Spanner) have reactive support via R2DBC.
Confirm support for async.client.MongoClient
Particularly Mongo will report incorrect metrics for Async which has been an issue for a while.
Review https://github.com/topics/nrlabs instrumentation for Mongo async, Lettuce, etc.
Aha! Link: https://newrelic.aha.io/features/JAVA-295
Write instrumentation and instrumentation tests for MongoDB reactive streams.
The text was updated successfully, but these errors were encountered: