Mongo DB specific errors in Java Agent Log - Error formatting Database
search cancel

Mongo DB specific errors in Java Agent Log - Error formatting Database

book

Article ID: 214199

calendar_today

Updated On:

Products

DX Application Performance Management DX APM SaaS CA Application Performance Management (APM / Wily / Introscope)

Issue/Introduction

JavaAgent mongodb monitoring appears to be working but the below error is reported continuously in the Agent log :

[ERROR] [IntroscopeAgent.SpringMongo] Mongo DB might be down, Error formatting Database : Error looking up method getLegacyDb on class org.springframework.data.mongodb.core.SimpleMongoClientDatabaseFactory with parameters

OR

"[ERROR] [IntroscopeAgent.SpringMongo] Mongo DB might be down, Error formatting Database : Error looking up method getMongo on class com.mongodb.client.internal.MongoDatabaseImpl with parameters",
..

Environment

  • DX APM Agents SaaS
  • DX APM Agents on-premise 2*
  • Mongo DB driver version 4.11.1

Cause

We use reflection API calls for the older mongo db versions.

The error message is a result of a driver version incompatibility with the APMIA MongoDB monitoring extension invoking Spring Data MongoDB API org.springframework.data.mongodb.MongoDbFactory.getLegacyDb() method that is not supported by the MongoDB version used by the application. Monitoring will still take place but the DB name is not identified and the generic name MongoDB will be used.

Enhancement request has been created to better handle this situation: US990828- Add support for Mongo DB driver version 4.11.1

Resolution

No workaround available.

Workarounds:

1) Use the boot.load property  to skip this extension itself, remove spring-mongo-<versionn>  from  introscope.agent.extensions.bundles.boot.load 
 
For example, if you are using 23.3.0.4, you would need to remove spring-mongo-d7788aaaxt1-2023.3.0.4  from  introscope.agent.extensions.bundles.boot.load
 
[INFO] [IntroscopeAgent.Agent] introscope.agent.extensions.bundles.boot.load = spring-mongo-d7788aaaxt1-2023.3.0.4,muleesb-4b188589xt1-2023.3.0.4,async-http-client-d778922cxt1-2023.3.0.4,play-framework-d7868f66xt1-2023.3.0.4,spring-reactive-d7788e6bxt1-2023.3.0.4,browser-agent-ext-2023.3.0.4-java-gae,java-async-d7788e6bxt1-2023.3.0.4
 
2) Suppress the error from the extension, you can turn off the logging from the module or use FATAL
 
introscope.agent.log.level.IntroscopeAgent.<Module>=OFF
OR
introscope.agent.log.level.IntroscopeAgent.<Module>=FATAL
 
3) Alternatively, if your platform support: install MongoDB InfraAgent to monitor the DB.

Additional Information