# Mongo driver 4.x is not supported on Java

**URL:** <https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571>\
**Category:** APM\
**Tags:** java\
**Created:** [September 14, 2020, 6:13pm UTC](https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571 "2020-09-14T18:13:51Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![marcelo.pio](https://avatars.discourse-cdn.com/v4/letter/m/e47c2d/32.png) [@marcelo.pio](https://discuss.elastic.co/u/marcelo.pio)\
**Post date:** [September 14, 2020, 6:13pm UTC](https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571/1 "2020-09-14T18:13:51Z")

</div>

**Kibana version** :7.9

**Elasticsearch version** :7.9

**APM Server version** :7.9

**APM Agent language and version** :Java - 1.18.0

**Browser version** :Firefox 80.0.1

**Original install method (e.g. download page, yum, deb, from source, etc.) and version**: Maven

**Fresh install or upgraded from other version?** Fresh install

**Is there anything special in your setup?** None

**Description of the problem including expected versus actual behavior. Please include screenshots (if relevant)**:  
The base interface from MongoDB driver (com.mongodb.connection.Connection) was deleted on version 4.x of the driver, and so the APM for Mongo is not working in newer drivers.

APM agent: [https://github.com/elastic/apm-agent-java/blob/master/apm-agent-plugins/apm-mongoclient-plugin/src/main/java/co/elastic/apm/agent/mongoclient/MongoClientInstrumentation.java](https://github.com/elastic/apm-agent-java/blob/master/apm-agent-plugins/apm-mongoclient-plugin/src/main/java/co/elastic/apm/agent/mongoclient/MongoClientInstrumentation.java)

3.12: [https://github.com/mongodb/mongo-java-driver/blob/3.12.x/driver-core/src/main/com/mongodb/connection/Connection.java](https://github.com/mongodb/mongo-java-driver/blob/3.12.x/driver-core/src/main/com/mongodb/connection/Connection.java)

4.0: [https://github.com/mongodb/mongo-java-driver/blob/4.0.x/driver-core/src/main/com/mongodb/connection/Connection.java](https://github.com/mongodb/mongo-java-driver/blob/4.0.x/driver-core/src/main/com/mongodb/connection/Connection.java)

**Steps to reproduce** :

1. Run APM agent 1.18.0 on a spring boot application version 2.3.3.RELEASE with Mongo

**Errors in browser console (if relevant)**: None

**Provide logs and/or server output (if relevant)**: None

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [September 15, 2020, 2:02pm UTC](https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571/2 "2020-09-15T14:02:48Z")

</div>

Hi @marcelo.pio, welcome to our forum !

Yes, we currently only support MongoDB version 3.x (as written [in our documentation](https://www.elastic.co/guide/en/apm/agent/java/current/supported-technologies-details.html#supported-databases)).

We use [this form](https://docs.google.com/forms/d/e/1FAIpQLScd0RYiwZGrEuxykYkv9z8Hl3exx_LKCtjsqEo1OWx8BkLrOQ/viewform) to prioritize framework/library support, have you already filled it ? However, it does not include any part relative to storage nor a specific version (please add it to the last freeform input).

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [October 6, 2020, 10:02am UTC](https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571/3 "2020-10-06T10:02:59Z")

</div>

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.

---

<div class="post-metadata">

**Author:** ![Sylvain\_Juge](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sylvain_juge/32/55521_2.png) [@Sylvain\_Juge](https://discuss.elastic.co/u/Sylvain_Juge)\
**Post date:** [December 1, 2020, 8:39am UTC](https://discuss.elastic.co/t/mongo-driver-4-x-is-not-supported-on-java/248571/4 "2020-12-01T08:39:02Z")

</div>

Hi @marcelo.pio.

FYI we have opened an implementation issue as we want to add support for newer versions of the MongoDB driver to the agent. Feel free to subscribe/comment on the issue so you'll get notified when we start working on it.

> <https://github.com/elastic/apm-agent-java/issues/1547>
>
> Initially reported in our forum
> Our current support for MongoDB is limited to 3.x version of the driver.
> https://mongodb.github.io/mongo-java-driver/4.1/driver/getting-started/installation/
> There are two variants of...

Have a nice day !
