Repository navigation
[Bug] java mongo 5.x plugin not support #13296
Description
Search before asking
- I had searched in the issues and found no similar issues.
Apache SkyWalking Component
OAP server (apache/skywalking)
What happened
The environment information is as follows:
verision info:skywalking-oap-10.2.0
agent:java 9.4.0
mongo-driver:org.mongodb:mongodb-driver-sync:5.0.1
skywalking-api.log If there are a large number of error messages like the following:
ERROR 2025-06-03 00:09:11.384 location-kafka-thread-3 InstMethodsInter : class[class com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor] before method[execute] intercept failure
java.lang.IllegalStateException: Exit span doesn't include meaningful peer information.
at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:170)
at org.apache.skywalking.apm.agent.core.context.TracingContext.inject(TracingContext.java:150)
at org.apache.skywalking.apm.agent.core.context.ContextManager.createExitSpan(ContextManager.java:136)
at org.apache.skywalking.apm.plugin.mongodb.v4.support.MongoSpanHelper.createExitSpan(MongoSpanHelper.java:46)
at org.apache.skywalking.apm.plugin.mongodb.v4.interceptor.MongoDBOperationExecutorInterceptor.beforeMethod(MongoDBOperationExecutorInterceptor.java:47)
at org.apache.skywalking.apm.agent.core.plugin.interceptor.enhance.InstMethodsInter.intercept(InstMethodsInter.java:83)
at com.mongodb.client.internal.MongoClientDelegate$DelegateOperationExecutor.execute(MongoClientDelegate.java)
at com.mongodb.client.internal.MongoCollectionImpl.executeInsertMany(MongoCollectionImpl.java:505)
at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:487)
at com.mongodb.client.internal.MongoCollectionImpl.insertMany(MongoCollectionImpl.java:482)
at org.springframework.data.mongodb.core.MongoTemplate.lambda$insertDocumentList$18(MongoTemplate.java:1568)
at org.springframework.data.mongodb.core.MongoTemplate.execute(MongoTemplate.java:603)
at org.springframework.data.mongodb.core.MongoTemplate.insertDocumentList(MongoTemplate.java:1561)
at org.springframework.data.mongodb.core.MongoTemplate.doInsertBatch(MongoTemplate.java:1421)
at org.springframework.data.mongodb.core.MongoTemplate.insert(MongoTemplate.java:1360)
at com.gwm.tsp.service.impl.VehicleHistoryLocationServiceImpl.insertLocationList(VehicleHistoryLocationServiceImpl.java:55)
at com.gwm.tsp.consumer.VehicleHistoryLocationKafkaConsumer.recordParseInsertDdeLocation(VehicleHistoryLocationKafkaConsumer.java:143)
at com.gwm.tsp.consumer.VehicleHistoryLocationKafkaConsumer.lambda$listenLocationHistory$0(VehicleHistoryLocationKafkaConsumer.java:86)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:572)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1583)
What you expected to happen
Nothing
How to reproduce
Nothing
Anything else
No response
Are you willing to submit a pull request to fix on your own?
- Yes I am willing to submit a pull request on my own!
Code of Conduct
- I agree to follow this project's Code of Conduct
Activity
wu-sheng commentedon Jun 5, 2025
Please follow the document. This is not a bug.
https://skywalking.apache.org/docs/skywalking-java/next/en/setup/service-agent/java-agent/supported-list/
xiaobaiadm commentedon Jun 5, 2025
Thank you for your reply.
wu-sheng commentedon Apr 9, 2026
Fixed in apache/skywalking-java#802 (milestone: Java Agent 9.7.0).
Root cause: MongoDB Java Driver 4.11+ removed
Cluster.getDescription(). TheMongoRemotePeerHelpernow usesgetCurrentDescription()instead, which is available since driver 4.x.Test coverage extended to MongoDB driver 4.11.5.